Query Records
Introduction
Feature Overview
At a Query Records node, multiple records in the target form can be queried, and the result can be repeatedly referenced by subsequent action nodes.
Scenarios
The records queried at Query Records can be called by subsequent nodes for batch actions.
Scenario | Problem Statement | Solution on Jodoo |
Vehicle Management | How to track the warranty coverage status of each vehicle? | Set an Automations Pro that regularly queries vehicles whose warranty is expired, and marks the warranty status as "To be renewed". |
Database Management | How to reduce data redundancy? | Set an Automations Pro that regularly queries and deletes outdated data. |
Project Management | How to synchronize the status of each task related to a project when there is any update? | Set an Automations Pro that queries the related tasks and updates their statuses automatically. |
Preview
In the project management scenario, when the project status is updated, the statuses of the related tasks are synchronized.
Setup Steps
After creating an automation, you will be directed to the design page. Here, you should first configure the Trigger node. After that, go on to configuring subsequent action nodes.
Adding the Action Node
Add a Query Records node under existing node(s).
Selecting the Target Form
A target form is the form from which the Query Records node retrieves data. You can select a form as the target form, from the current app or one of the others.
Adding Condition(s) for Query
Add one or more conditions based on your needs, which enables Automations Pro to query the specific records that meet the condition(s).
Click Add Condition, the settings required are as follows:
- Logic among conditions: When you set multiple conditions, decide whether to retrieve data that meet all the conditions or those that satisfy any of them.
- all of: The logic among multiple conditions is "and". The records that meet all the conditions get retrieved.
- any of: The logic among multiple conditions is "or". The records that meet any one specific condition get retrieved.
- Fields in the target form: Select fields in the target form, or system fields (Created User, Created Time, Updated Time, and Workflow Status).
- The rule for filtering: Apply rules based on the types of fields in the target form, and the options are equals, does not equal, contains, does not contain, is empty, is not empty, etc.
- The filter values: Select Field Value or Custom from the drop-down list. If you select Custom, enter the value manually.
Note:
1. The filtering logic and the filter value can vary based on the type of the selected target field. If you use a subfield for filtering, the suitable filtering logic can only be one of these four: equals any/does not equal any/contains/does not contain. For details, see Illustrations for Filter Value.
2. You can use field values from data stored at some nodes as the filter values. These nodes include the trigger node, Query Record, Query records, Add record, Add formula, and Add Plugin. If the trigger of the automation is a Scheduled Trigger and the Trigger Time is customized, the data at the trigger node cannot be used as the filter values.
3. You cannot set conditions for the following fields in the target form: Divider, Query Data, Select Data, Button, the current node, and the current approver.
Adding Sorting Rules
Before the final data are obtained, the existing records will be sorted according to Sorting Rule. Query Records will retrieve the certain number of the sorted records in order, based on the Number of Queried Results you set.
1. To add a sorting rule, you need to
- Choose fields to sort by. You can sort the records by multiple form fields. The supported field types are:
- Form fields: Single Line, Number, Date&Time, Radio, Single Select, Serial No.
- System fields: Created Time, Updated Time, URL Parameter
- Choose sorting order: Ascending or Descending
2. Set the maximum number of records to be queried. The default limit is 200.
Note:
1. Each field can be selected in a sorting rule only once. Up to 5 sorting rules can be added.
2. If you do not add a sorting rule for a Query Records node, Automations Pro will randomly retrieve the specified number of records from the target form.
Notes
General Instructions
1. Query Records can retrieve a maximum of 200 records at a time.
2. When the query result at a Query Record node is used at subsequent action nodes, and when the result is empty, the run at subsequent nodes will be affected. For details, see Action Nodes.
Calling the "Records amount" Parameter
When the query result of the Query Records node is called by a subsequent node, the query node will provide a parameter, Records amount, which can act as a single-value numerical field for value assignment. The value of Records amount is the number of records queried.
1. Notes on Calling "Records amount"
Records amount is a real-time value, and will always gets the latest total number of queried records. For example, if the Querys Record node queries 2 record, but these record are deleted before the automation flows to the next relevant node, the Records amout value will be updated to 0. Therefore, when the subsequent node calls Records amount, the value will be 0.
2. Use Case
Take generating a supplier statement as an example.
When an application is initiated, the automation will query all the inbound receipts of the products from the supplier, and calculate the number of entries by calling Records amount of the query node. The results will be written into the Supplier Statement form.
The Path Condition node calls the Records amount parameter to determine whether the customer is recorded. The automation will flows onto different paths based on the set condition: