Prepopulate form with additional parameters

I would like to be able to pre-populate fields in a form from information passed in a query string.
I have set up the “Additional Parameters” to bring this data in, but I don’t know how to get it into a form element.

Mark

Morning Mark,

I built just such a presenter to help you do this.
https://community.netcall.com/appshare/i/url-parameter-value-presenter/

You can either use this with default settings to prefill an editable text field, or you can hide it using the hidden option, to capture the value without the user being aware.

Hope this helps.

1 Like

Hi Adam,

Thank you. I have uploaded this presenter to my host. I am not sure how to specify the key I want.

There is a small user guide in the documentation area of the presenter in community.

image

There is a section lower down in setting for you to enter your parameter key, guid in the example shown.

image

1 Like

Thanks Adam,

Sorry, but this is not the behaviour I am looking for.
I have a url like this:
https://cheshireeast-core-build.oncreate.app/w/webpage/request?form=dummy_form_mark&id=abcde

I want to be able to use that id on my form.
I can display the additional parameter as you can see below, but the presenter is not picking it up.

Hi Mark,

The issue is clearly with the URL redirection, the id is being stripped on redirect.
If you add it to the resolved redirect the presenter works as intended.
Where is the URL you are providing coming from and we can see if we can preserve extraneous URL params.

See:

image

https://cheshireeast-wasteservices-build.oncreate.app/w/webpage/634GBFBC1?context_record_id=447205&webpage_token=301d5916769af68a16d1ec1031158f91531ec438e8a0237cde089a9845e7b621&id=2468

1 Like

Thanks Adam. That url is on the start page of my form.

I have set up “additional parameters” to capture stuff from the referring url’s query string. How can I access these from the presenter?

Mark

Hi,
I have created the behaviour I need using a Fragment Callback. It’s not ideal as I don’t have the ability to set the parameter key in the interface.

return {
  main: function (myObj) {
    const values = myObj.get_values();
    myObj.set_value(values[cs.ref('testId')]);
  },
};

Is there a way I can adapt this so that it has an input on the form build interface to set the key?

Hi,
Many thanks for your help with this. A member of my team has shown me how to do this using dependencies.