Creating an active link guide that loops through a table field
You can also build workflow to:
- Skip rows, based on mathematical calculations on field values.
- Find a row that has changed values and perform an action on it, using the $ROWCHANGED$ keyword.
- Find a row that has been selected and perform an action on it, using the $ROWSELECTED$ keyword.
For more information about keywords, see Operators, wildcards, keywords, and NULL values.
The following example procedure creates a simple loop that searches through all the rows of a table field until it finds a ticket with a specific user's name on it. The workflow then sets a field with values from a column in the table field. The procedure assumes you already know how to create forms, fields, workflow, and guides.
To create an active link guide that loops through a table field
- Create a form (for example, Loop Test):
- Add a button field (Button).
- Add a table field that includes at least the following fields as columns. Use the Tree/Table property in the Properties tab to add:
- Submitter (Column)
- Request ID (Column2)
- Save the form.
- Create an active link (Loop Test SF Active Link):
- Associate it to the Loop Test form.
- Enter a Run If Qualification: 'Column' = $USER$
This condition executes the active link only if the value of the Submitter field is set to the person who is logged in to mid tier. - Add a Set Fields action and in the field mapping table, set:
- Name: Short Description
- Value: $Column2$
This action puts the Column2 value, which is the value of the Request ID field, into the Short Description field.
- Save the active link.
- Create an active link guide (Loop Test Guide):
- Associate it to the form.
- Add the Loop Test SF Active Link to the guide.
- Save the guide.
- Create an active link (Loop Test Active Link Button):
- Associate it to the form.
- Set the Execution Options to Button/Menu Field and select the Button field.
- Add a Call Guide action:
- In the Guide Name field, select Loop Test Guide
- Set Table Loop to All rows.
This action activates the guide and causes it to loop through the rows in the table field.
- In the Guide Field field, select the table field added to the form in Step 1.
- Save the active link.
- Log in to the mid tier as user Demo and open the Loop Test form in New mode.
- As a test, create several tickets, but only one with Demo as the value of the Submitter field.
- Open the Loop Test form in Search mode.
- Click the table field to refresh it. The tickets you just created appear as rows.
- Click the button field on the form.
The active link guide is triggered and loops through all the rows in the table field until it finds a row with Demo as the value of the Submitter field. The workflow then fills in the Short Description field with the value of the Request ID field.
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*