URL parameters

URL parameters

Compose Enterprise is going through a design update. The illustrations on this page might be of the old design, but the information is up to date. Thank you for your patience during this update!

Norsk

End-users can access workflows through a URL provided by Compose. Depending on your internal system, different parameters may be added to the URL, e.g. https://demo.usecompose.com/cng/YouTubeTutorial/param?orgnr=916158378&year=2021. These added URL parameters can be used to populate a form. In Compose this can be done through workflow variables added in the workflow builder, or by adding the workflow activity name/element alias to the URL.

In this example (in which the workflow is available as a cng-file at the bottom of the page) we’ve created a form for reviewing the financial year for an organization.

We aim to use URL parameters to populate the organization details and also the financial year the end-user wants to see.

For the pages, we’ve added a display condition based on what year is populated in the Year question (Q5). The screenshot to the right, depicts the Conditions tab of the Financial year 2021 page. We’ve added the same display condition for the other pages, so the relevant page for the relevant year is displayed after the population. Underneath is an example of the respondent view where the URL parameter populating the Year answer has been set to 2021.

As you can see, only the Financial year 2021 page is displayed since the other display conditions for the other pages are false. To get started with adding URL parameters, go to your workflow and head into the Variables section.

We need to create parameter variables. Click Create to add a new workflow variable. Give the variable a name and press OK.

Double-click the variable to edit the variable properties.

Select Parameter Value and enter a name for the parameter in the input field (preferably a short name since it will be in a URL). If the form answer you aim to populate has a specific validation, then the validation of the parameter value must be changed to the same validation.

If you would like to use multiple parameters to populate the form, repeat the previous step and add as many workflow variables as needed.

Navigate to the Builder section and select the form activity (or any activity which you’d like to populate with the parameter values).

In the form properties panel, click the Prepopulate questions button (make sure a form is selected).

The panel for managing the prepopulation of question answers opens. Click the Select question from model button to select the question you’d like to prepopulate with a parameter value.

The data model of the connected form is displayed. Select the question you would like to populate and click OK.

Repeat this step if you’d like to prepopulate multiple question answers. Select the question and select the Value from Workflow radio button. Click Browse to see what workflow variables and values are available.

Expand the list of Workflow Variables by clicking the arrow head and select the Variable you would like to map to your selected question. Then click OK.

The value from the year URL parameter will now be directly populated to the Year question (Q5). Repeat the steps above if you selected multiple questions.

We will use the other URL parameter, orgnr, as the request variable in a generic service call to the Brønnøysund Registre Centre (a Norwegian register issuing organization details) to populate the organization details in the form. See the Generic services (form and workflow population) user guide for connecting generic services directly in a form activity in the workflow builder.

Please save the draft and version the workflow. The launched access URL for the workflow will not contain the URL parameters, so you will have to add them manually. The syntax for adding parameter values in a Compose URL is the following:

Base Compose URL + ? + parameter={insert value} + & + parameter={insert value} + & + etc.

E.g.: https://demo.usecompose.com/cng/YouTubeTutorial/param?orgnr=916158378&year=2021

In the listed URL, the parameter values are orgnr with value 916158378 and year with value 2021. The resulting prepopulation in the respondent view is illustrated below:

Question aliases as URL parameters

You can also populate form questions by referencing their aliases in the service URL. Let’s take the same form as in the above example.

Here, the zip code question has the alias zip. The syntax for referencing question aliases also involves the name added to the form activity in the workflow (in this case the name Form).

The syntax for referencing question aliases is formActivityName.alias={insert value}. So, say we’d like to set the zip code to 0858 and the year parameter value defined earlier in the example to 2020, then the URL would be

The respondent view will then be generated with the values populated.

Note: There is no limitation to the amount of parameters and question aliases which can be referenced in a URL.

The examples from this user guide are attached in the workflow file below: