This recipe describes how to create a drop down list from a silo query in Service Panel. This can be used in scenarios when you want to present a list of locations, sites, org units, departments, jobs, etc. and have the user choose one.
This technique can be used to have a single selection produce multiple values in the workflow engine.
Prerequisites
This walk-through presumes that you have an existing silo in Identity Panel (e.g. a SQL table scanned by the data provider) which will furnish objects for the query.
Add a Query Data Source
In your Shared Form Data Sources, or your form's Data Sources section add a Query Data Source list provider.
Set Query filters with:
Data Type: ObjectRecord
Silo: special.Identity Silo.<tablename>
Object Type : <optional>
Deleted: null
Set the Value Rule
Create a value rule that combines the value for the workflow and the display label using a "|" or the SelectItem function. Assuming you are choosing multiple fields from the queried object here are several options:
Method 1 (separated list of values for workflow processing):
Value Rule (note you can use any separator character except '|'):
SelectItem(Attributes.department + "^" + Attributes.title, Attributes.department
+ " " + Attributes.title)
Workflow/Fixture Rule:
department is: Split(Data.PageName.JobField, "^").0
title is: Split(Data.PageName.JobField, "^").1
Method 2 (lookup function in workflow processing):
Value Rule:
SelectItem(CoerceString(Id), Attributes.department
+ " " + Attributes.title)
Workflow/Fixture Rule:
department is:
ResolveId(Data.PageName.JobField, special.Identity Silo.<tablename>).Attributes.department
Explanation:
The ResolveId(objectId, silo)
function will lookup and return a Time Traveler object record. By saving the Id of the object in the form data we permit the workflow engine to lookup the actual object record and retrieve any attributes from that object.
Comments
0 comments
Please sign in to leave a comment.