Query Parameters
Query parameters are a useful way to send information to a Form to support registering key user data and pre-filling fields.
They work like hidden fields, which can be used to customize your Form with information you already know when you’re sharing it with users. Some examples are:
- Pre-filling fields with the user's id
- Recording the referring URL via a utm_source parameter (e.g. Linkedin, Google, Instagram, etc.)
Query parameters can be accessed through the get_query_params()
function
# If form is accessed using `your-domain.abstra.app/form_id?param1=foo¶m2=bar`
from abstra.forms import get_query_params
params = get_query_params()
print(params['param1']) # foo
print(params['param2']) # bar
print(params) # {'param1': 'foo', 'param2': 'bar'}