For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Open sourceSupportFAQsDocs Home
DocumentationAPI referenceRelease notes
DocumentationAPI referenceRelease notes
  • Platform On-Prem
    • Overview
    • Navigate
    • Search resources
  • Apps
      • Overview
      • Navigate
        • Configure and manage tasks
        • Null vs. undefined values
        • Parallel branches
          • Overview
          • addDuration
          • arrayIncludes
          • arrayLastIndexOf
          • arrayPop
          • arrayToString
          • assign
          • calculateTimeDiff
          • charAt
          • charCodeAt
          • childjob
          • codePointAt
          • concat
          • concatArray
          • convertEpochToObject
          • convertTimeFormat
          • convertTimeToEpoch
          • convertTimezone
          • copyWithin
          • csvStringToJSON
          • deepmerge
          • delay
          • endsWith
          • ErrorHandling
          • evaluation
          • eventListenerJob
          • excelToJson
          • extractField
          • fill
          • FlattenJSONFormInput
          • getTime
          • includes
          • arrayIndexOf
          • indexOf
          • isArray
          • join
          • keys
          • lastIndexOf
          • length
          • length (string)
          • localeCompare
          • makeData
          • map
          • match
          • merge
          • modify
          • newVariable
          • normalize
          • objectHasOwnProperty
          • objectToString
          • padEnd
          • padStart
          • parse
          • parseInt
          • pop
          • push
          • pushToArray
          • query
          • repeat
          • restCall
          • reverse
          • runCode
          • search
          • setObjectKey
          • shift
          • slice (array)
          • slice (string)
          • sort
          • split
          • startsWith
          • stringValueOf
          • stub
          • substring
          • toLocaleLowerCase
          • toLocaleString
          • toLocaleUpperCase
          • toLowerCase
          • numberToString
          • toString (array)
          • toString (number)
          • toString (object)
          • toUpperCase
          • transformation
          • trim
          • trimEnd
          • trimStart
          • unshift
          • updateJobDescription
          • values
          • viewData
    • FlowAI
    • Itential Automation Gateway
  • Resources
    • Itential Academy
    • Version lifecycle
    • Itential MCP
    • Accessibility conformance
    • Get support
    • FAQs
LogoLogo
Open sourceSupportFAQsDocs Home
On this page
  • Configure pushToArray
  • Example
  • Track failed devices
  • Platform 6 changes
  • What changed
  • Migrate your workflows
  • Best practices
  • Related tasks
AppsStudioTasksTask reference

pushToArray

Was this page helpful?
Previous

query

Next
Built with

Add elements to an array in a workflow.

Use pushToArray to collect results during iterations, track errors or failures, and build lists dynamically.

Platform 6 requirement: Arrays must be created before using pushToArray. See Platform 6 changes below.

Configure pushToArray

PropertyTypeRequiredDescription
Select Job VariableDropdownYesThe job variable to receive the new item.
Item LocationDropdownYesWhere to find the item: Static, Job, or Earlier Task.
ItemVariesYesThe value to add. Text box for Static; dropdown for Job or Earlier Task.

Example

Track failed devices

Collect devices that fail VLAN configuration:

START → newVariable: failedDevices []
→ forEach deviceList
└─→ Configure VLAN
├─→ success → continue
└─→ error → pushToArray: failedDevices

The result is that failedDevices contains all devices where configuration failed.

Platform 6 changes

What changed

Platform 6 requires arrays to exist before use.

VersionBehavior
Platform 2023.2Creates array automatically
Platform 6Requires array creation before use

Migrate your workflows

Add a newVariable task before pushToArray:

1

Add a newVariable task

Add a new newVariable task to your workflow.

2

Set the variable name

Set variableName to your array name.

3

Set the initial value

Set variableValue to [].

4

Position it before pushToArray

Place the newVariable task before pushToArray in the workflow.

As a best practice, create all variables at the start of the workflow. See Workflow Best Practices.

Best practices

  • Create arrays at start: Define all variables after the Start task.
  • Use descriptive names: For example, failedDevices rather than array1.
  • Handle errors: Add error transitions from pushToArray.
  • Multi-thread: Create multiple variables in parallel.

Related tasks

  • newVariable — Create job variables.
  • query — Extract data from arrays.
  • merge — Combine objects.