Adding a Record Select Diagram Element to a Flow
Functions
This diagram element is for querying instance records of platform objects by condition, akin to using a "SELECT" statement in a database.
Using the Record Select Diagram Element
- On the flow designer, choose Basic and drag the Record Select diagram element to the canvas.
- Click the Record Select diagram element, click
, and set basic information.
- Click
and complete the configuration.
- If you select Use fast lookup mode in the previous step, you need to specify a predefined object variable or object variable array, drag the object variable or object variable array to the variable text box, set conditions, and select a sorting mode, in this way, the query result can be saved in the object variable according to the condition and sorting mode. Query object data by condition and save the query result to the object variable Account, as shown in Figure 1.
Table 2 Parameters for the fast query mode Parameter
Description
Variable
Predefined object variable or object variable array.
The query result is automatically saved in the object variable or object variable array. If the object variable is not an array, only the first record that meets the condition is saved. If the object variable is an array, all returned records are saved.
You can drag a variable from the context or directly enter an object variable or object variable array.
Assign null value if no record is found
If no record is found based on the search criteria, the variable is left blank.
This parameter is selected by default.
Condition
After an object is selected, the fields of the object are displayed in the field column. Click Add Row to set the conditions for querying data.
Select the object field to be judged from the field drop-down list, select the corresponding comparison operator from the operator drop-down list, and drag a variable from the context or enter {!Variable name} in the value text box.
(Sort) Sort Field/Order
Sorts queried data in ascending or descending order based on a field.
- If Use fast lookup mode is not selected in the previous step, you need to specify an object and set the values of some fields of the specified object in the condition. The system queries the object records that meet the condition and assigns the values to the set variables. Query the record whose name is Lily of the Account object and assign the queried object ID to the var_record_id variable, as shown in Figure 2.
Table 3 Parameters for the common query mode Parameter
Description
Object
Name of the object to be queried. Select the target object from the drop-down list.
Is Distinct
Indicates whether to keep just one record and remove all duplicates in the search results.
By default, this parameter is not selected, indicating that duplicate records are not deleted.
Condition
After an object is selected, the fields of the object are displayed in the field column. Click Add Row to set the conditions for querying data.
Select the object field to be judged from the field drop-down list, select the corresponding comparison operator from the operator drop-down list, and drag a variable from the context or enter {!Variable name} in the value text box.
(Sort) Sort Field/Order
Sorts queried data in ascending or descending order based on a field.
Skip Value
Pagination parameter. Skip the first n records and start to display from record n+1.
Drag a variable from the context, enter {!Value variable name}, or enter a constant.
Limit Value
Maximum number of records displayed on each page.
Drag a variable from the context, enter {!Value variable name}, or enter a constant.
Assign Total Record Numbers to Variable
The total number of queried records is stored in the variable.
Drag a variable from the context or enter {!Value variable name}.
(Output) Source/Target
Output result. You can click Add Row to add a row.
Source is the field to be queried and can be selected from the drop-down list box. Target can be a variable dragged from Context or a variable name.
Assign null value if no record is found
If no record is found based on the search criteria, the variable is left blank.
This parameter is selected by default.
- If you select Use fast lookup mode in the previous step, you need to specify a predefined object variable or object variable array, drag the object variable or object variable array to the variable text box, set conditions, and select a sorting mode, in this way, the query result can be saved in the object variable according to the condition and sorting mode. Query object data by condition and save the query result to the object variable Account, as shown in Figure 1.
Querying Multiple Data Records
You can configure the Record Select diagram element to output a multi-line data list for the object. For example, if the device object Namespace__Equipment__CST has been created in the application and the following two data records exist, you can configure the Record Select diagram element in the flow to query all device names in this object. Procedure:

- Create a flow with both name and label as queryEquipment by referring to Creating a Flow.
- Define variables for the flow.
In this task, you need to query multiple rows of data of an object. Therefore, you need to create an array variable of the object type for output.
- In the right pane of the flow editing page, click
.
- On the Context panel, click the plus sign (+) next to Object Variable.
Figure 4 Creating an object variable
- Set the object variable. Retain the default value record, set the parameter name to Equipment (or another name), select the object Namespace__Equipment__CST to be queried, select array, and click the save button.
Figure 5 Setting object variable information
- In the right pane of the flow editing page, click
- Add and configure the Record Select diagram element.
- Drag the Record Select diagram element under Basic from the diagram element list on the left to the canvas.
This diagram element is used to query object records based on conditions.
Figure 6 Dragging Record Select to the canvas - Click the Record Select diagram element, click
, and configure the diagram element.
Figure 7 Configuring the diagram elementTable 4 Parameters for querying a common record Parameter
Description
Object
Name of the object to be queried. Select an object from the drop-down list.
Is Distinct
Indicates whether to keep just one record and remove all duplicates in the search results.
By default, this parameter is not selected, indicating that duplicate records are not deleted.
Condition
Click Add Row to set the conditions for querying data.
(Sort) Sort Field/Order
Sorts queried data in ascending or descending order based on a field.
Skip Value
Pagination parameter. Skip the first n records and start to display from record n+1.
Drag a variable from the context, enter {!Value variable name}, or enter a constant.
Limit Value
Maximum number of records displayed on each page.
Drag a variable from the context, enter {!Value variable name}, or enter a constant.
Assign Total Record Numbers to Variable
Total number of records that can be queried.
Drag a variable from the context, enter {!Value variable name}, or enter a constant.
(Output) Field Name/Target Variable
Output result. You can click Add Row to add a row.
- Set Field Name to the name field of the device to be queried. You can select a value from the drop-down list.
- For Target Variable, drag the name field of the object variable from the context. After the dragging, the value of Target Variable is Equipment[0].name.
Assign null value if no record is found
If no record is found based on the search criteria, the variable is left blank.
This parameter is selected by default.
- Change 0 in Equipment[0].name to *.
If the wildcard is not used, only one data record can be queried.Figure 8 Changing 0 to a wildcard
- Drag the Record Select diagram element under Basic from the diagram element list on the left to the canvas.
- Connect the Start and Record Select diagram elements.
On the canvas, move the pointer to the
diagram element and drag the pointer from + to add a line between the Start diagram element and the Record Select diagram element.
Figure 9 Connecting the Start and Record Select diagram elements - Click the blank area on the canvas, click
on the right, and drag the output parameters from the object variables in Context to configure the output parameter of the flow.
Figure 10 Setting the output parameter of the flow - Click
in the upper part of the flow page to save the flow.
- Test whether the flow can be executed properly.
- Activate the flow.
After the test is successful, click
in the upper part of the flow editor to activate the flow. A flow can be called by pages or other services only after it is activated.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot