Skip to main content

DELETE

Use the DELETE function to remove an item from an Array at a specified position.

Use

DELETE( array, position )
Delete the item in the array at the specified position.

ParameterRequiredDescription
arrayYesan array of any type
positionYesthe position in the array (starting from 1) of the item to delete

ReturnsArray matching the type of array1

Examples

Pruning a User-Submitted List

In a scenario where a user submits a "Task List" (Text Array) via a trigger form, you might have a standard procedure where the first item is always a placeholder or an instruction that should not be included in the final report. You can use this in an Input Mapping formula to clean the data for the next reviewer.

  • Formula: DELETE(@Trigger.out.TaskList, 1)
  • Logic:
    • @Trigger.out.TaskList: This identifies the array of text items produced by the trigger step.
    • 1: This tells the function to remove the item at the first position.
    • Result: If the user submitted ["Instruction Row", "Buy Paper", "Call Client"], the reviewer will only see ["Buy Paper", "Call Client"].

Managing a Queue via Variable Updates

You can use DELETE within a Variable Update formula to manage a dynamic queue of IDs or codes. For instance, once the most urgent item in a "PriorityCodes" (Number Array) has been processed, you can remove it to "advance" the queue.

  • Formula: DELETE($PriorityCodes, 1)
  • Logic:
    • $PriorityCodes: This refers to a variable holding a collection of numbers.
    • DELETE(..., 1): This removes the item at the very beginning of the array.
    • Result: The result of this formula replaces the variable's old value with the new, shorter array. This effectively shifts all remaining items in the queue up by one position, ensuring the next run of the logic accesses the new "first" item.