Define Named Records

Intelligent Advisor Flows was only made available to select customers, and will not be made Generally Available.

The global input schema in the Flow Engine API can optionally also define named records that can be referred to within the flow editor. Take the following:

The property settings for a named record in a flow scheme in Intelligent Advisor Hub

In this scheme, we have added an array property with named records to the global input data. The named values "Low", "Medium" and "High" can be used when referring to fields that are setting a reference to the priority object, without needing to include them in quotes.

For example, to set a field with a named record in the priority field:

A rule in a flow project showing an object and record referred to directly

Or to compare a reference field to an specific record:

A rule in a flow project showing a reference field compared to a specific record

At runtime the IAFlowSession.globalInputDataDefinition looks like:

{
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "date": {
            "type": "string",
            "format": "date"
        },
        "userName": {
            "type": "string"
        },
        "priority": {
            "type": "array",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "name": {
                        "type": "string"
                    }
                },
                "required": [
                    "name"
                ]
            }
        }
    }
}

and we can set data like:

{
    "date": "2021-08-13",
    "userName": "Philip Sherman",
    "priority": [
    	{"name": "High"},
    	{"name": "Medium"},
    	{"name": "Low"}
    ]
}

A couple of important things to note about name fields:

  • As you can see from the globalInputDefinition, the nominated "Identity for data collection and naming" is a required field for any named array. The nominated name property must always be a string, but is not required to be explicitly added as a property of the array in the scheme definition. If it is left out it will automatically be added.

  • Named arrays can only exist as a root property of the global input data. They cannot be nested as a property of another array.

  • If a named property is used in the flow, then it must be supplied in the global input data for it to be valid. Taking the above rule samples, both the records named "High" and "Low" are referenced by name. So for the global input data to be valid it must contain at least two "priority" objects, one named "High" and one named "Low". You can optionally provide other objects in your global input data, even if they are not explicitly named in the scheme but you must supply the referenced objects.