Updated on 2025-08-15 GMT+08:00

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

  1. On the flow designer, choose Basic and drag the Record Select diagram element to the canvas.
  2. Click the Record Select diagram element, click , and set basic information.

    Table 1 Parameter description

    Parameter

    Description

    Label

    Label of the diagram element, which is displayed on the flow design page. The system automatically assigns a value in a specific RecordSelectsequence number format, with the sequence number starting at 0 for each type of diagram element.

    Name

    Diagram element name, which must be unique in the current flow. The naming requirements are as follows:

    • Value: 1–80 characters.
    • Start with a letter and can contain letters, digits, and underscores (_). It cannot end with an underscore (_).

    Description

    Description of the diagram element.

    Value: 1–255 characters.

    Use fast lookup mode

    Whether to enable the quick query mode.

    • If this parameter is selected, the quick mode is used.

      You only need to configure query conditions. The query results are automatically saved in object variables. 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.

    • If this parameter is not selected, the common mode is used.

      To query object records by condition, you need to specify the object name, query conditions, and field list to be queried. The query result must be saved to the configured variables.

    This parameter is deselected by default.

  3. 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.
      Figure 1 Fast query mode
      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.
      Figure 2 Common query mode
      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.

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:

Figure 3 Existing data
  1. Create a flow with both name and label as queryEquipment by referring to Creating a Flow.
  2. 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.
    1. In the right pane of the flow editing page, click .
    2. On the Context panel, click the plus sign (+) next to Object Variable.
      Figure 4 Creating an object variable
    3. 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

  3. Add and configure the Record Select diagram element.

    1. 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
    2. Click the Record Select diagram element, click , and configure the diagram element.
      Figure 7 Configuring the diagram element
      Table 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.

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

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

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

  6. Click in the upper part of the flow page to save the flow.
  7. Test whether the flow can be executed properly.

    1. Click in the upper part of the flow editor to execute the flow.
    2. Click the run button without entering the test data.

      If the operation is successful, all device names in the device object are displayed.

      Figure 11 Example response

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