Redirect users to URLs with variables
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!
When workflows end or are paused, the end user can be redirected to another web page via URLs. End-users can be redirected after end points, pause points and after cancelling their workflow.
End-users can be redirected to static URLs, but they can also be redirected to a URL containing variable parameters (URL parameters). Let's say you want to have a survey after a service to get feedback on the user experience. In addition to redirecting the user to the survey, you could redirect information from the service, and use it in the survey by e.g. pre-populating it as a question answer.
In this user guide, we have a service (workflow) with two entry points – one start point for external users and one start point for internal users, e.g. employees. (Take a look at the Multiple start points in a workflow user guide in order to learn more about workflows with multiple start points).
We would like to redirect end-users who cancel their workflow (Cancel workflow) to a survey to get feedback to why they cancelled. We can have multiple flows (start point to end point) in the same workflow, so let's build the survey flow in the same canvas. In this fictitious demo, we aim to store the survey feedback as statistics in Power BI. To be able to use redirection variables, URL parameters must be established. Enter the Variables section.
Create a new variable. Let's say we'd like to know whether the end-user is an external or internal user in the survey (aka. the entry point/start point). Double-click the variable or select the Edit icon.
Set the variable to have a parameter value and give the parameter a short name. A short and simple name like entry is practical so the URL doesn't become too long (especially if you have multiple redirection variables). Save the settings and re-enter the Builder section.
Select one of the start points in the main service (External or Internal) and scroll down to the Cancel Option properties. Select User can cancel session and enter the Redirect variables menu to define what workflow values we'll send as parameters in the URL.
Create a new variable, select Value from workflow and then Browse.
Select the workflow variable you want to send as a parameter. We want to send the name of the start point, aka. the entryPointName.
We can now add the survey URL in the Redirect user to URL field with the parameter variable. Select the start point of the survey flow and note down the URL Path End (which needs to be unique in the workspace).
The first part of the redirection URL is the complete survey URL, aka.:
Compose environment + / + workspace name + / + survey URL Path End
This example:
https://demo.usecompose.com/cng + / + Doku + / + cancelSurvey
https://demo.usecompose.com/cng/Doku/cancelSurvey
The syntax of adding parameters connected to redirect variables is as follows:
URL + ? + parameter + ={ + redirect variable + }
This example:
https://demo.usecompose.com/cng/Doku/cancelSurvey + ? + entry + ={ + var + }
https://demo.usecompose.com/cng/Doku/cancelSurvey?entry={var}
Multiple variables are separated by the & character, aka. ... ?entry={var}&?time={date}& ... etc. Remember to repeat these steps for the Internal start point too if you also have multiple start points! To test that the parameter value reaches the survey, select the form activity and enter the Prepopulate questions menu.
Select a question from the form to prepopulate, select it to be populated with a value from the workflow and Browse.
The parameter variable we defined is accessible from the Workflow Variables. Select it and remember to save the workflow draft.
Create a new version and launch the main service from either start point to test the redirection.
Click the Cancel button and confirm the cancellation in the modal window. Note: The texts associated the cancel button, modal window etc. have been customized (which is demonstrated in the Cancel workflow user guide).
If the workflow was correctly configured, you are redirected to the survey. The question you chose should also be prepopulated with the name of the start point you started the main service from.
The flexibility of the redirection functionality in Compose opens many doors in regards to what processes you can build. If you'd like to have a consultation with one of our workflow architects, then send us a demo request or send an email to post@usecompose.com.