Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Example if the payload variable is a list like below

[{"name":"A","id":"1"},{"name":"B","id":"2"}]
and you have a _flow variable collected in earlier actions like this:
["A":['n1','n2'],"B":['n3']]

Then when using this syntaxr

"{{{flowVarMerge payload _flow 'name' 'newProp'}}}"

The function will output

[{"name":"A","id":"1","newProp":['n1','n2']},{"name":"B","id":"2","newProp":['n3']}]

Expand

Lets say we have this payload as input for the action, which is an array of groups.

Code Block
[
	{
		"lastUpdated": "2023-09-29T10:41:01.000Z",
		"lastMembershipUpdated": "2023-09-29T13:02:48.000Z",
		"created": "2023-09-29T10:41:01.000Z",
		"profile": {
			"name": "Everyone",
			"description": "All users in your organization"
		},
		"objectClass": [
			"okta:user_group"
		],
		"id": "00gbmoe6l7vn9hhyh5d7",
		"type": "BUILT_IN"
	},
	{
		"lastUpdated": "2023-09-29T10:41:03.000Z",
		"lastMembershipUpdated": "2023-09-29T10:41:03.000Z",
		"created": "2023-09-29T10:41:03.000Z",
		"profile": {
			"name": "Okta Administrators",
			"description": "Okta manages this group, which contains all administrators in your organization."
		},
		"objectClass": [
			"okta:user_group"
		],
		"id": "00gbmoe6ohcS7J7pq5d7",
		"type": "BUILT_IN"
	},
	{
		"lastUpdated": "2023-09-29T13:03:18.000Z",
		"lastMembershipUpdated": "2024-04-24T16:51:49.000Z",
		"created": "2023-09-29T13:03:18.000Z",
		"profile": {
			"name": "Superheros",
			"description": null
		},
		"objectClass": [
			"okta:user_group"
		],
		"id": "00gbms1al0OOKFwsW5d7",
		"type": "OKTA_GROUP"
	}
]

Now we want to add a new property called groupMembers into each array element.

The groupMembers data comes from a collection of data before and we are using Dynamic Flow Variable to store the data.

Data looks like this:

Code Block

Here is how we merge it

Code Block