Skip to content

Add Tags to Process

Scenario

Use this example when work items should be categorised automatically with tags so they are easier to find and filter in the worklist.

Prerequisites

  • permission to create a folder and process
  • access to process forms and task scripting
  • a test user who can start the process and inspect the worklist

Steps

Create the Folder and Process

  1. Create an application folder, for example Expense Form.
  2. Create a process in that folder and open it in edit mode.

Build the Tasks

  1. Rename the opening task to Expense Form.
  2. Add the Submit action.
  3. Create the approval task and add Approve and Reject actions.
  4. Route Reject back to the first task.

Process diagram with the expense form and approval tasks.

Design the Form

  1. Create the form for the opening task.
  2. Add a row-content layout.
  3. Add a table-content control for the list of expenses.
  4. Add a static list so the user can choose values such as Travel, Hotel, or Ticket.

Form designer with the table-content control used to collect expense types.

Option 1: Add Static Tags in Prework

If the same tags should appear every time the process starts, use the opening task prework:

1
$Instance.Tags = ["Tags", "Added", "To", "Instance"];

Use this option when the process should always be grouped under the same fixed tags.

Option 2: Add Dynamic Tags in Postwork

If the tags should come from submitted form data, use the task postwork:

1
2
3
$Instance.Tags = $Xml.SelectAll('Process/ExpenseList/Expense', function(type) {
   return type.Evaluate('ExpenseType/Text');
});

Use this option when the selected values in the form should become searchable worklist tags.

Task postwork editor used to set tags from the submitted XML data.

Save and Test

  1. Commit the process changes.
  2. Start the process from the folder.
  3. Submit the form once with static tagging enabled, then again with dynamic tagging enabled.
  4. Open the worklist and compare the resulting tags.

Worklist showing tags added to the running process.

Result

The process now adds tags either statically or dynamically, and those tags appear in the worklist for filtering and review.