Skip to main content
All CollectionsLanding Pages & Co Reg Further ways to Customise
Get Query String Parameters from a URL and populate a Databowl Field
Get Query String Parameters from a URL and populate a Databowl Field

Need to pass information to the landing page, or maybe prefill a field? then this is for you

Korey Abbott avatar
Written by Korey Abbott
Updated over 2 years ago

PLEASE NOTE: This code requires some technical knowledge and understanding of jQuery

If you're wanting to pass data to the form to supplement what the user submits, or maybe pre-fill options such as their name from a link in an email, then you'll need some additional code adding to your landing page Javascript.

The following code should be added to your form page.

var queryParamFieldIdMap = {
//e.g, query-string parameter: field to update
first_name: 'F_1_FIRSTNAME',
};

//you do not need to change this below code.
Object.keys(queryParamFieldIdMap).forEach(function (queryParam) {
if(queryParamValue){
var queryParamValue = sb.URI.getQueryParameterByName(queryParam);
$('input[name="' + queryParamFieldIdMap[queryParam] + '"]').val(queryParamValue).trigger('change');
}
});

This example assumes you will be passing on a singe value for 'first_name' to the field F_1_FIRSTNAME eg: domain.com?first_name={{first_name}}
​
The script will read the first_name from the url and update the field What we're doing is mapping the query string first_name to a Databowl field. This will then populate a Databowl field with {{first_name}}.
​
​


πŸš€ Need More assistance?

If you're stuck or if this isn't something you or your team is comfortable with, then please open a new chat/ticket (chat icon in the bottom right of the screen) or email support@databowl.com.

We're here to assist with any questions you have, and if required we can quote on actioning work like this for as part of our Marketing Services.

Did this answer your question?