Is there a way to pre-populate a field on a form using a parameter that is attached to the form's URL?
Idea/scenario behind this: We could send out personalized links to people from whom we'd like to gather some information, e.g. https://[my-form-url]?UserID=27
Result: When the receipient opens the link in the browser, the field "UserID" would already be filled with the value 27 without the need to enter the number manually.
Hello @Matheus_Felipe,
Welcome to Plumsail Community!
You can populate form fields with data from query parameters using the code.
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
//populate field with CustomerID query parameter
fd.field('User').value = urlParams.get('UserID');
Place the code inside fd.rendered if you are suing Public web forms, and inside fd.spRendered for SharePoint forms.
1 Like
Hello, thanks for you answer,
how i can pre populate the form, with ID from sharepoint list?
When I create a NEW ITEM in a sharepoint list, automatically (by power automate) I send a public plusmail form, to the receiver of the form "with the same id that was created in pre-populated sharepoint, so that when the user answers the form, the answers are added to the "item created in the sharepoint list related to the ID
@Matheus_Felipe,
You can build a link with multiple query parameters like this:
https://[my-form-url]?UserID=27&ID=2
And on the form, populate the SharePointID field using the same code that I've shared.