Using spfx webparts, would there be a way to either programmatically send an email which has a link to open a modal or using flow? - email

I want an spfx made webpart that I've made be able to send an email (I'm using IEmailProperties at the moment) which provides a link to a modal form?
For example:
User clicks button in webpart, form loads.
User fills out form and submits it to SP list.
Form sends email on submission. Email has a link to the actual item created, so when the user clicks the provided email link, it opens up the modal form.
I would presume that the user would HAVE to be sent to the SP page where the webpart is unconditionally, but would it be possible to open up the modal corresponding to the SP list item?
Is this feature available in SharePoint framework, because if it isn't, compared to something like InfoPath 2013 or PowerApps it's quite a limitation.
I've researched this with several shallow Google searches and on gitHub for any premade stuff, but alas there is nothing that I've spotted.
I've been told IT IS possible:
"Yeah, they’d have to visit the page. Email clients don’t do JavaScript so you can’t really do interactive stuff there. If you want to take them directly to a page that then displays a modal, that’s plenty possible though. (e.g. display the modal based on if the URL contains a certain string)"
But wouldn't know how to do the above, can anyone start me on the right path?
Regards,
T

In the email, pass a query string containing the item ID/list ID etc of the item, then have the webpart read the See: How can I get query string values in JavaScript? If your values exist. If they do exist, then open the modal using some kind of framework like bootstrap or fluent UI. You can write your own form using PnPjs or use an iframe potentially to display the OOTB edit form.
Additionally, you can link to any page in SharePoint provided you use an extension instead of a webpart to host the modal. You can install extensions tenant wide, and have it listen for the query string.

Related

Can I read a value from one SharePoint web part into the the form for a list in another web part?

I'm not sure if it's possible to do what I'm hoping, but maybe I'll get lucky. It has to do with setting form fields in a SharePoint 2010 list, using InfoPath forms.
Basically, I have one list with requests from several vendors. Each vendors has their own requests page which is a Web Part Page with one web part: a list of submissions with a custom view applied that filters it only to them. This is a (clunky but functional) way to ensure each vendor only sees their own requests. To submit a new request, they click on the "Add Item" link at the bottom of the list web part. At this point, a customized InfoPath form pops up, and they add their request.
In the form, one of the fields is "Vendor". What I would like to achieve is to have the InfoPath form read something on the page which tells it which vendor's page it was called from and pre-select that vendor (I could then disable the control so they couldn't change it). I am happy to alter the calling page as needed, or to configure the InfoPath form (can you custom-configure GET or POST values or anything to define a field that way?).
Any help would be very appreciated.

Using ninja forms, how can I persist field values across pages?

I have a form on the home page of quotedjobs.com that I would like to persist the field values of across pages.
For example: A user enters some values in fields, such as job title (textbox), job type (list) and job description (text field). Underneath that I ask users to register on the site, but they have the option to click a link to allow them to login if they are already members.
What I would like to be able to do, is to redirect users to another form that is a copy, but allows them to login instead of register, but keep hold of the values that they entered in the title, type and description form of the previous page so they aren't losing their work.
I have seen the ninja_forms_processing variable in the docs, but I'm not clear on how to use that.
TL;DR - You can't.
As it was slim pickings here, I sent an email over to support. Got this response:
Hello,
At this time this use case is not possible in Ninja Forms. The plugin is currently unable to transfer data from field to field or between forms.
I’m sorry that we do not have a better solution for you at this time.
Thank you,

How do I make a link that pre-fills a form checkbox?

I have a page called contact.htm with a working form. One of the checkbox fields on the form is named Garden (so either it is checked or not when using the form).
I have another page that I want to link to my form page, so that if a user clicks a particular link, they are sent to the form page and the field Garden is pre-clicked.
I have not been able to do this though I have tried several methods...such as:
a href="contact.htm?checkbox=Garden,on" or
a href="contact.htm?checkbox=Garden,checked" or
a href="contact.htm?input type="checkbox" name="Garden" value="checked", and some others.
I would appreciate any help.
You'll need to use JavaScript on the target webpage to process the argument and fill the values in. There is no automatic way of doing this just by URL.
This link shows how to retrieve URL arguments from JavaScript. From there, it's a matter of using standard JavaScript or JQuery to fill the values in.

Zend Framework: How to POST data to some external page (e.g. external payment gate) without using form?

I would like to have a user redirected to an external credit card gate. Of course I have to POST some user info to that gate, but I don't know how exactly can I do this.
I know that I could do this by generating a html form with hidden or read-only fields and have a user click "Submit" button. But this solution is not perfect, because all the form data could be easily changed using e.g. Firebug. I think you cannot do this using $this->_redirect(...). But maybe there is some other solution?
Many thanks for any tips or suggestions.
I would like to have a user redirected to an external credit card gate. Of course I have to POST some user info to that gate, but I don't know how exactly can I do this.
Using a form is the only method available. The RFC states that the user should explicitly agree to sending a POST (i.e. click on a submit button).
I know that I could do this by generating a html form with hidden or read-only fields and have a user click "Submit" button. But this solution is not perfect, because all the form data could be easily changed using e.g.
It is no more secure that using a redirect as the header data can be modified without too much of a problem. There are even Firefox plugins to do it.
use cURL to post data
http://framework.zend.com/manual/en/zend.http.client.adapters.html

How to create a form in SharePoint that modifies query string

My request is simple.
I want to put a form (a text field let's say) on a Sharepoint page, with a submit button.
When i submit, I want the URL to be reposted with the s="textfromtextfield".
Say i was on a url http://site/site.aspx?p=x clicking submit will take me to:
http://site/site.aspx?p=x&s="textfromtextfield"
If this button "is completely yours" and not one of sharepoint controls you might try writing the following code on the button click handling method on the server side.
Page.Response.Redirect(newUrl, true);
More than likely you want to open the page in SharePoint Designer and add/play with form actions. Check this page for details (rather than attempt to communicate it step by step):
http://office.microsoft.com/en-us/sharepointdesigner/HA101191121033.aspx
FYI. SharePoint Designer is now free for download from Microsoft.
If you have never edited a form in SharePoint Designer, this may help:
http://office.microsoft.com/en-us/sharepointdesigner/HA101191141033.aspx