
Overview
The Pop Block removes either the first or last element from an array and outputs both the removed element and the remaining array. By default, it pops the last element. This block is useful for processing array elements one by one in a loop.Key Features
- Removes and returns the first or last element of an array
- Outputs both the popped element and the remaining array
- Configurable to pop from the front or back of the array
- Useful for iterative array processing
Inputs
The array to pop from. Required. Non-array inputs will not be coerced.
Outputs
The popped element. Will be labeled as “First” if popping from front, “Last” if popping from back.
The remaining elements of the array after popping.
Editor Settings
If enabled, the first element of the array will be popped instead of the last.
Example: Pop the last element from an array
- Create an Array Block with values
["John", "Doe", "30", "Engineer"]. - Add a Pop Block and connect the Array Block to its
arrayinput. - Run the flow. The
Lastoutput should be"Engineer"and theRestoutput should be["John", "Doe", "30"].
Example: Pop the first element from an array
- Create an Array Block with values
["John", "Doe", "30", "Engineer"]. - Add a Pop Block, enable the
Pop from frontsetting, and connect the Array Block to itsarrayinput. - Run the flow. The
Firstoutput should be"John"and theRestoutput should be["Doe", "30", "Engineer"].
Error Handling
The Pop Block will error if:- The
arrayinput is not provided - The input is not an array
- The input array is empty
FAQ
Can I pop multiple elements from an array at once?
Can I pop multiple elements from an array at once?
No, the Pop Block can only pop one element at a time. To remove multiple elements, use multiple Pop Blocks in sequence.
Can I use the Pop Block to pop elements from a string?
Can I use the Pop Block to pop elements from a string?
No, the Pop Block only works with arrays. For string manipulation, consider using a Code Block with custom JavaScript.
What if the array is empty?
What if the array is empty?
The Pop Block will error if the array is empty. Use an If Block to check if the array is empty before popping from it.


