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.

  1. We drag and drop a Condition step onto the workflow.


  2. 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.)


  3. 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:

    OptionDescription
    FileChecks the value of file metadata, such as the file path or file owner.
    UserChecks the value of user metadata, such as the user name or the user's last login.
    MetadataChecks 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.
  4. In this example, we choose Metadata.
    The next drop-down list in the query builder includes the following conditions related to the metadata:

    ConditionDescriptionExample
    Exists for the fileIf the metadata and metadata attribute exist, this is true.  If cce.pii exists as a metadata group and attribute
    Exists for the file with valueIf 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 arrayIf 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 conditionIf the metadata and metadata attribute exist and match the condition given, this is true.if invoice.amount exists and is > 500
  5. In this example, we choose Exists for the file that matches the following condition.
  6. 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:


  7. 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.

  8. 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: