Split last item from collection
The Split last item from collection action A tool for building the processes, logic, and direction within workflows. stores the value of the last item in the specified collection A variable containing multiple items, such as email addresses. Collection variables are useful for storing and operating on query results. For example, you can set up collection variables for names, email addresses, and index values to store results from querying a list. You can then loop through items in a particular collection variable (names, emails, or index values). to another variable and removes the last item.
For example, while iterating through sorted query results, you might use this action to return the last value in the collection.
Before you begin:
-
Understand Variables
-
Understand the Start a loop and Loop for each actions
Jump to:
Add and configure the Split last item from collection action
In the Designer page:
-
Click the Collection operations action group in the action toolbox.
or
Find actions by browsing action groups, or by typing an action name or function in the Search field at the top of the action toolbox.
- Drag the Split last item from collection action to the point in the workflow when you want to remove the last item in a collection variable.
- Click the Split last item from collection action.
-
Complete the fields. For more information on the fields, see Split last item from collection fields.
Field
Example configuration
Example returned contents
Target collection collProduce lemon; apple; carrot; romaine
Value of last item
textLastItem
romaine
Output
collProduceTrimmed
lemon; apple; carrot
Field |
Description |
Variable types |
---|---|---|
Target collection | Collection variable that you want to remove the last item from. Accepts an inserted variable. |
Collection |
Value of last item |
Variable to store the value associated with the last item in the collection variable. Accepts any combination of typed text and inserted variables. |
Boolean, DateTime, Decimal, File, Integer, Text |
Output |
Collection variable to store the new set of items after the last item is removed. Accepts an inserted variable. |
Collection |