Creating a Workflow Query
When you add a condition to a workflow, you are prompted to enter the query for determining if the condition is true or false. Some common queries entered include:
- Is the file greater than a specific size?
- Is a value above a specific dollar amount?
- Is the user who performed the action an External (or Guest or Full) user?
To create a query for a condition:
In the following example, we'll create a query that checks if an uploaded invoice file is for an amount greater than $500, and if it is, we'll send it for approval. Following the step by step procedure is a video that shows you the complete process at once.
- We drag and drop a Condition step onto the workflow.
- Then, we click Add in the right panel to add a query using the query builder. (Alternately, we could have clicked Text Editor (Advanced) to enter the query freehand.)
- New Rule adds a one-rule condition. New Rule Group creates a multiple-rule condition.
In this example, we choose New Rule.
The query builder opens.In the first drop-down list in the query builder, we choose the part of the workflow that the query is evaluating.
The following options are available:Option Description File Checks the value of file metadata, such as the file path or file owner. User Checks the value of user metadata, such as the user name or the user's last login. Metadata Checks if a certain metadata attribute exists for the file, and if it does, what its value is. Ctx (Context) Checks the value of the current date, the current date and time, or the workflow name. In this example, we choose Metadata.
The next drop-down list in the query builder includes the following conditions related to the metadata:Condition Description Example Exists for the file If the metadata and metadata attribute exist, this is true. If cce.pii exists as a metadata group and attribute Exists for the file with value If the metadata and metadata attribute exist and have the given value, this is true. If cce.pii exists and is equal to yes Exists for the file with value in array If the metadata and metadata attribute exist and have the one of the values in the array, this is true. If cce.pii exists and is equal to one of the following: yes, y, unknown Exists for the file that matches the following condition If the metadata and metadata attribute exist and match the condition given, this is true. if invoice.amount exists and is > 500 - In this example, we choose Exists for the file that matches the following condition.
- The condition can be set to True or False. Here, we leave it at True.
The query editor indicates the format for the final part of the query. In this case it is metadata, operator, value: - We enter invoice.amt,>,500 and click Save.
The condition is complete. Now, we can add a workflow step that occurs either when the condition is found true or when it is found false, or both. - We add a step to wait for approval if the condition that the invoice amount is > 500 is true.
The following video shows the same query being created: