How-to: Send a pre-filled form as a workflow task

Prev Next
This content is currently unavailable in German. You are viewing the default (English) version.

Use a workflow to automate the form pre-filling with index data and send out the pre-filled form as a task to assignees for form completion.  

Take the purchase order request form below as an example. The form fields “Requestor” and “Date” are already filled with only predefined entries and set to read-only.

The goal is to pre-fill the form fields Supplier and Project with the values collected in the workflow. Then the pre-filled form link is sent as a workflow task to the decision maker for completing the form with values for the Cost Center and Contact. After that the decision maker should submit the form.

Set the prefilling up as a workflow in the Web-based Workflow Designer:

  1. Create a new global variable. This will be used as the destination for the Assign data activity and the task dialog in the Web Client.

  2. The variable is named “PFFormURL” as an example:

  1. Add an activity of the type Assign data to the workflow.

  2. Add the first assignment and then open the Data assignment.

  3. Set the Destination type to Global Variable.

  4. Choose the Global Variable you have created in the first step as the Destination entry. Here it is PFFormURL.

  5. Set the Source type to Expression.

  6. Set up the expression like explained below.

How to write the expression

Write the expression with the basic formula.  

Start with the system variable Organization Domain, followed by the URL of the form you want to prefill.

The form URL parameter is always built in the same way: /formsweb/ + the title of the form followed by “?” + pf=on. Add hpyhens, if the title has multiple words.

/formsweb/name-of-your-form?pf=on

From here, you can start to compose the parameters through combining variables, index fields, and the function.  

For the fields that need to be pre-filled with data collected in the workflow, use its Field ID, index field and ConvertToURLString function to create a parameter.

For instance, to prefill the form field Supplier with the value of the index field “Company”, enter “Supplier=” & ConvertToURLString(Company).

How to handle fields with ready-only predefined entries

If the form fields, which are already pre-filled, need to be read-only, use the respective checkbox in the field settings. The checkbox Read-only is only visible when the field has a predefined entry to ensure the value remains unconditionally read-only. This means the value will not be visible or editable in the URL.

However, if your predefined values in DocuWare Forms are not set to read-only, or are set to read-only using the option Behaviors, you must specify them in the workflow expression. If you do not specify them in the URL the fields would not be pre-filled in the form link. The following image shows an example - see the parameters marked red:

Note, this approach is not recommended since the values remain editable in the URL. It’s better to set the fields to read-only via the checkbox in the field settings. This allows you to completely remove these two parameters for Requestor and Date in the Expression. The values will not even be visible in the URL.

So this should be how the final Expression look like in the actual example.

  1. Add an activity of the type Task to the canvas.

  2. Choose Method > Dialog.

  3. Go to Decision and add the first decision.

  4. In the Decision, go to the Dialog tab to add a the first field.

  5. Choose as field type the option Link and as Predefined type > Global variable.

  6. Enter as Predefined Source your global variable PFFormURL.

Now, after the workflow is triggered, the decision maker receives a task that contains the pre-filled form link. The decision maker may insert the remaining fields “Cost Center” and “Contact” and then submit the completed form.