Nodes
Clear#
The Clear node is used to empty an array variable, removing all its elements. It's useful when you need to reset an array to its initial empty state, typically at the beginning of a loop or after processing the array's contents.
Inputs#
flow(required): The flow input that triggers the node's execution.array(required): The array variable to be cleared. If not provided, an empty array will be used as the default value.
Outputs#
flow: The flow output that is triggered after the array is cleared.array: The cleared array variable, which will be an empty array.
Configuration#
This node does not have any configuration options.
Usage#
- Connect the 
flowinput to the desired trigger point in your spell, such as a button click or the completion of a previous action. - Connect the 
arrayinput to the array variable you want to clear. If left unconnected, an empty array will be used. - Connect the 
flowoutput to the next action you want to perform after the array is cleared. - If needed, connect the 
arrayoutput to other nodes that require the cleared array. 
Example#
Suppose you have a spell that processes an array of user-selected items. After processing the items, you want to clear the array so that the user can start a new selection. Here's how you can use the Clear node in this scenario:
- Create an array variable named 
selectedItemsto store the user-selected items. - Use a node like Get Items to populate the 
selectedItemsarray based on user input. - Process the items in the 
selectedItemsarray using nodes like For Each or Filter. - After processing the items, connect the 
flowoutput of the last processing node to theflowinput of a Clear node. - Connect the 
selectedItemsarray to thearrayinput of the Clear node. - The Clear node will empty the 
selectedItemsarray, preparing it for a new round of user selection. 
Best Practices#
- Use the Clear node when you need to reset an array to its initial empty state, such as before starting a new iteration of a process that populates the array.
 - If you want to create a new empty array without modifying an existing one, you can use the Create Array node instead.
 
Common Issues#
- Ensure that the 
arrayinput is properly connected to the array variable you want to clear. If left unconnected, the Clear node will output an empty array, but it won't modify any existing array variables. - Remember that clearing an array is a destructive operation. If you need to preserve the original array contents, consider creating a copy of the array before clearing it.