Search Object

Use a Search Object node in your Flow to query, filter, sort, and return matching Records of the specified Object Type to your Flow. To configure a Search Object node in the Flow Editor, drag it from the Palette to the Workspace canvas, then double-click the node to open and configure its behavior.

Example of settings for a Search Object node
Example of settings for a Search Object node
  1. Provide an optional Name for the node.

    • By default a Search Object node will be shown with a label of "search object", but the value you provide in the Name field will replace it in the Flow Editor UI making your flow easier to read and understand.

  2. Select a Config for the node.

    • Note

  3. Select a Type Id for the node, a value specified using one of several options.

    • type - choose this option for a dropdown that includes the Display Names of the Object Types you have created in your Contextual tenant. If the dropdown appears empty for you, be sure that your Flow has been initialized with a Config, after which the dropdown will be kept in sync with your tenant.

    • string - choose the string option, and type in a string for the Object Type ID that you want to search, using type is recommended instead of string

    • msg. - choose this option to specify a path in the msg. object that contains the Object Type ID value that you want to perform the search against, e.g. msg.payload.thePropertyWithTheObjectTypeId, msg.event.thePropertyWithTheObjectTypeId, or msg.customObject.thePropertyWithTheObjectTypeId- the msg. object and its content are available to nodes within any flow in the same Flow Editor window (i.e., across multiple tabs in the Node-RED Flow Editor interface).

    • flow. - values in the flow. scope can be set and retrieved by nodes that exist within the same tab of your flow in the Contextual Flow Editor.

    • global. - values in the .global scope are shared, and can be set and retrieved, by nodes across any tab of your flow in the Contextual Flow Editor.

    • env variable - Environmental Variables are a feature of Agents in Contextual. Any Environmental Variables that you define as Label/Value pairs for an Agent that is sending events to a Flow, will be available to the Flow, simply type the Label of the Evironmental Variable from which you want to use the value.

  4. Specify a required Page Size to limit the number of results that will be returned to your flow.

  5. Specify the Output msg. object path for the search results, e.g. msg.mySearchNodeResults.

  6. Choose a Filter Mode

    • AND will... note

    • OR will... note

  7. Add one or more Search Statements by clicking "+add" at the bottom left of the Search panel. Searches are partial match, are not case-sensitive, and are applied sequentially and cumulatively top to bottom as they are arranged in the Search panel. Use the drag-and-drop handle on the left of each row to re-order as needed.

    • Type the object path you want to evaluate on the left

    • Choose the source of the value you want to use to perform the search

      • Designate a msg. object path

      • Designate a flow. or global. variable as the source of the value

      • Choose string, and type in a value

  8. Add one of more Filter Operations by clicking "+add" at the bottom left of the Filter panel. Filters are applied sequentially and cumulatively top to bottom as they are arranged in the Filter panel. Use the drag-and-drop handle on the left of each row to re-order as needed.

    • exactSearch - Not supported at this time.

    • exists - Not supported at this time.

    • exclude - Not supported at this time.

    • includes - Not supported at this time, use a Search Statement instead.

    • from - often paired with to, can be used to filter to results in a particular range of numeric, date, or string values

    • to - often paired with from, can be used to filter to results in a particular range of numeric, date, or string values

  9. Add an optional Order By Statement by clicking "+add" at the bottom left of the Order By panel to order the data using the value of a numerical or date property.

    • Type the object path you want to evaluate on the left

    • Designate either asc or desc sort order

    • Best practice is to have a single Order By statement. If you have defined more than one Order By statement, generally, the first row in the list is the one that will be used. However, if you declare conflicting Order By statements (e.g. date asc as the first row, then date desc as the second statement) the last one in the list (date desc in this example) will be used. Use the drag-and-drop handle on the left of each row in the list to re-order as needed.

When the Search Object node is included in the path of your flow, it will retrieve and return Record data as configured, for further use within your flow.

Last updated