Lists
API actions for the Lists integration.
Lists
Count, sort, add, remove, and clean up lists.
Add item to end
Add an item to the end of a list.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
items | array | Yes | |
value | object | Yes |
Response
{
"status": "success"
}Create a list
Create a list by entering its items one by one.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
items | array | Yes |
Response
{
"status": "success"
}Filter list
Keep only the items in a list that match a condition, and return them as a new list. Build the condition the same way as an “If” step, referring to the current item as “item”.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
items | array | Yes | |
condition | string | Yes | Only items for which this is true are kept. Refer to the current item as “item” (for example, item.price is greater than 100). |
Response
{
"status": "success"
}Get first item
Get the first item of a list. If the list is empty, returns an empty list (shown as “Empty list”).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
items | array | Yes |
Response
{
"status": "success"
}Find item position
Find where an item appears in a list. Returns -1 if it is not found.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
items | array | Yes | |
value | object | Yes |
Response
{
"status": "success"
}Insert item
Add an item at a specific position in a list.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
items | array | Yes | |
index | number | Yes | 0 is the first item. |
value | object | Yes |
Response
{
"status": "success"
}Get last item
Get the last item of a list. If the list is empty, returns an empty list (shown as “Empty list”).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
items | array | Yes |
Response
{
"status": "success"
}Count items
Count how many items are in a list.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
items | array | Yes |
Response
{
"status": "success"
}Check if list includes item
Check whether a list includes a specific item.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
items | array | Yes | |
value | object | Yes |
Response
{
"status": "success"
}Combine two lists
Merge two lists into one, keeping the items of the first list followed by the items of the second.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
first | array | Yes | |
second | array | Yes |
Response
{
"status": "success"
}Remove item by position
Remove the item at a specific position in a list.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
items | array | Yes | |
index | number | Yes | 0 is the first item. |
Response
{
"status": "success"
}Remove duplicates
Remove repeated items from a list.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
items | array | Yes |
Response
{
"status": "success"
}Reverse list
Reverse the order of items in a list.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
items | array | Yes |
Response
{
"status": "success"
}Shuffle list
Put the items of a list in a random order. Returns all of the items, just reordered.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
items | array | Yes |
Response
{
"status": "success"
}Take part of list
Take a section of a list, such as the first five items or the last three.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
items | array | Yes | |
start | number | Yes | This item is included. Use a negative number to count from the end (-1 is the last item). |
end | number | No | This item is not included. Leave blank to go through the end of the list. Use a negative number to count from the end (-1 is the last item). |
Response
{
"status": "success"
}Sort list
Sort a list in ascending (first/smallest to last/largest) or descending (last/largest to first/smallest) order.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
items | array | Yes | |
direction | string | No | The order to sort in. |
Response
{
"status": "success"
}