Dear Plumsail,
I have read with interest your articles about pre-populating form data:-
- Public forms tips and tricks: How to create prefilled forms?
- Populate form with data from different sources with JavaScript (public forms) — Public web forms
But there isn’t enough material here for me to figure out how to get myself started. I can’t seem to find what I’m looking for in the community forum, and I think an expanded example would make a useful addition to your website!
For my use case, I wish to:
- Add a URL parameter called UserID (which I could happily do myself) and for this to populate a hidden field called UserID in the public form.
- Use the value of the UserID to lookup that person’s name, email and age in the following table, in order to pre-populate those form fields (though maybe they can modify their values in case their info has changed).
- I could host this table as an excel file on OneDrive for example (I don't wish to incorporate all the data within the URL itself as it will be too long, and I do not wish to populate the fields from their browser storage, as they might use multiple computers.)
- There will then be additional fields that they will fill in before submitting their form response. (For example their job title.)
I would be enormously grateful if you could give me the javascript code that I can paste into the JS editor in my plumsail form to get it working (after I have customized it with the correct url and field names), as well as giving step-by-step instructions (e.g. do the looked-up fields need to be dropdown type? Do they need to be disabled?) – While the use case above is a toy example, I can generalize it to my requirements.
UserID,Name,Email,Age
6576edgjhgc4r87654dt,JoeBloggs,joe.bloggs@emailtheplanet.com,Child
08u7udcwo3uz93bcigh,JohnSmithjohn.smith@supersupermail.com,Adult
Thank you!