Search for answers or browse about Sintel Forms.
Using query string parameters for default/calculated values
When dealing with default or calculated values in a form you can now use the new queryParam() function to set these values directly from the URL address that the users are using to open up a form.
In order to use this feature, following steps must be taken:
- queryParam() formula needs to be used in default/calculated value definition
- proper URL needs to be set up
Using the queryParam() function
The function needs to be simply typed in the default formula or the calculated formula fields on a field. See more details in related articles (default values, calculated values).
Syntax of the function is: queryParam(<name_of_query_parameter>), e.g. queryParam(“parameterOne”).
queryParam(“parameterName”) ? queryParam(“parameterName”) : “A default value”
The above formula will try to use the value of “form_parameterName” parameter present in the URL. If it can’t be found, the “A default value” text will be used instead.
Setting up the URL
Values returned by the queryParam() function are retrieved from the URL that has been used to open up a form in Sintel Forms. Therefore you need to extend the URL with proper key-value pairs by appending following text to it:
?form_<parameterName>=<value>
URL parameter examples |
Text field value for "defaultTitle" parameter: |
URL parameters need to be appended to an URL that points to list item creation/edition page.
For anonymous forms, you can use the anonymous access link that can be copied from Forms Designer.
For regular forms, you can use the default SharePoint list item URLs. For instance, an example link for adding a new item to the list is:
https://yourcompany.sharepoint.com/sites/nameOfTheSite/Lists/nameOfTheList/NewForm.aspx
After you add query parameters to this, it will look as follows:
https://yourcompany.sharepoint.com/sites/nameOfTheSite/Lists/nameOfTheList/NewForm.aspx?form_parameterOne=1&form_parameterTwo=A default value