Creating Public form link with variable

Hey there,

Is it possible to add URL Parameters to a public form so I can pass a variable?
For example, if I send the survey link to a client in an email, is it possible to use parameters within the form link to get the customer ID to the Form?

How can I do this?

Hello @5by5,

Welcome to Plumsail Community!

You can pass any data in query parameter and populate field on form load.

For instance, the form URL with customer ID query parameter is
https://forms.plumsail.com/preview/0f7452ee-e38a-450b-b504-073a05c?CustomerID=23

To populate the field on the form, use this code:

fd.rendered(function() {
    const queryString = window.location.search;
    const urlParams = new URLSearchParams(queryString);
    //populate field with CustomerID query parameter
    fd.field('Customer').value = urlParams.get('CustomerID');
});
1 Like