Skip to content

Generate Worklist Tags from Form Data

Scenario

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

What You Will Learn

  • add fixed tags during task prework
  • derive tags from repeating form data in postwork
  • verify the resulting tags in the worklist

Difficulty and Estimated Time

  • Difficulty: Intermediate
  • Estimated time: 20 minutes

Assumed Knowledge

You should be familiar with process forms, XML paths, prework, and postwork scripts.

Required Reading

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.

Verify the Result

Start instances with two different form values and confirm that each work item shows the expected tag. Test an empty value and confirm that it does not create a blank or misleading tag.

Security and Portability Notes

  • Tags are visible worklist metadata. Do not place secrets or unnecessary personal data in them.
  • Derive tags from validated values and keep the vocabulary stable when reports or filters depend on it.
  • The example uses no tenant-specific identifiers; adapt only the XML paths and labels required by your process.

What to Learn Next