Sequence Op
This operation evaluates all items in the sequence and returns last result.
Definition: ["sequence", <item1: expression(any)>, ...<itemN: expression(any)>]
- <item: expression(any)> - represents an expression to be evaluated.
Usage
Request:
In this example request this sequence will create a user, create a group with that user and link the group to the user's main group.
["sequence",
["var", "user", ["run", "createUser", ["value", {
"username": "test",
"password": "test"
}]
]],
["var", "group", ["run", "createUserGroup", ["object", {
"name": ["value", "My Group"],
"owner_id": ["var", "user.user_id"]
}]
]],
["run", "linkGroup", ["object", {
"to_group_id": ["value", 2],
"from_group_id": ["var", "group.group_id"]
}]
]
]
Response:
{
"group_linked": true
}
Typical Usage
You would use this operation if you need to run multiple operations sequentially, and you can do it all in one request. These include when you need to create an user and link it to an entity, or create multiple items all at once.