Get array data DAC
The Get array data dynamic advanced command is part of the variable commands. An array is a list of items stored in a single variable, each assigned a specific position. Use this command to retrieve data from an array based on its position in the list. You can extract individual items, entire rows of data, or perform calculations on the array, making this command essential for handling complex data structures. Drag it into a wizard from the Advanced commands view in the Nintex Wizard Editor to use it.
Before you begin:
Learn how to navigate the Nintex Wizard Editor of the Studio.
Understand how to create wizards and use advanced commands.
Understand variables.
Learn how to customize error handling within an advanced command.
Understand how to configure wizard fallbacks.
Use the Get array data command to enhance your automation in various scenarios:
-
Extract a specific element from an array.
-
Retrieve an entire row of data from a two-dimensional array.
-
Process data in a loop, where each iteration requires data from a different position in the array.
-
Get specific information from a variable containing a string of items (an "array"), such as the value of a specific item, the total number of items, or the result of a mathematical calculation like the average, maximum, minimum, or sum.
In the Nintex Wizard Editor, search for the Get array data command and drag it into your steps. Use the table below to configure each field and understand the settings:
Field | Description | What to do | |
---|---|---|---|
From the array stored in | The array variable from which you want to extract data. | Select the array variable that contains the data you need. | |
Where items are delimited by | Specifies how you separate the items in your array (e.g., commas, semicolons). |
Enter the delimiter used in your array. This field accepts text or variables. To use a variable, enclose its name in $ signs, like $variable$. Example: An array first,second,third,fourth where you delimit the items by commas. See Considerations for details on supported delimiters. |
|
Where items are preceded by | Indicates the characters that appear before each item in the array. |
Enter the characters that precede each item. This field accepts text or variables. To use a variable, enclose its name in $ signs, like $variable$. Example: An array <first><second><third><fourth> where you precede the items with <. |
|
and followed by | Indicates the characters that appear after each item in the array. Use this field in combination with the preceding field to define items enclosed by specific characters. | Enter the characters that follow each item. This field accepts text or variables. To use a variable, enclose its name in $ signs, like $variable$. | |
Get the value of item # |
Retrieves the value at the specified position in the array. Array indexing starts at 1, not 0. This means the first element in the array is at position 1. |
Enter the index number of the item you want to retrieve. Example: The value of item #2 in first,second,third,fourth is second. |
|
Get the total number of items | Returns the total count of items in the array. |
Use this option to find out how many elements are in your array. Example: For the array first,second,third,fourth, the total item number is 4. |
|
Get the |
Get the | Performs a calculation on the numeric values in the array, such as finding the average, maximum, minimum, or sum. All values in the array must be numeric for these operations to work. If there are one or more non-numeric values, the wizard will return an empty result. |
Choose the type of calculation you want to perform on the array values. See Considerations for more details. |
average | Calculates the average of all numeric values in the array. | Select this option to find the average (mean) of the numbers in your array. | |
maximum value | Identifies the largest number in the array. | Select this option to find the highest value in your array. | |
minimum value | Identifies the smallest number in the array. | Select this option to retrieve the lowest value in your array. | |
sum | Adds all the numeric values in the array. | Select this option to calculate the total sum of the numbers in your array. | |
Return the result in variable | The name of the variable to store the retrieved data. | Enter a variable to store the result. You can use an existing variable or create a new one. Use a descriptive name that reflects the data it will hold (e.g., total_sales, max_value, average_price). | |
Error handling | Instructions on how the wizard should manage errors during extraction. | Expand the Error handling option to assign an error variable. |
Follow these best practices when using the Get array data command:
-
Ensure the array contains the data you expect before using this command.
-
Test the command in your workflow with different positions in the array to ensure it retrieves the correct data.
-
Be mindful of non-numeric values in calculations. Use the Replace command to remove any non-numeric characters from the data. This ensures the array contains only numbers, preventing errors during processing.
-
Use appropriate delimiters. Make sure you’re using consistent and supported delimiters throughout your array. Refer to the delimiter rules for guidance on supported characters.
This example shows how to extract the maximum price from a product price list and verify the result.
-
Add the Set value command to your wizard to define the array with the product prices.
-
Add the Get array data command and complete the following fields:
-
From the array stored in: product_prices
-
Where items are delimited by: , (comma)
-
Get the: Select maximum value.
-
Return the results in variable: max_price
-
-
Use the View variable list command to verify the command works as intended.
When using the Get array data command, be aware of the following limitations:
-
The command supports a wide range of characters as delimiters, including alphabetical characters, common punctuation marks, and special characters. Below are examples of supported delimiters:
-
Alphabetical characters: A, b, C, etc.
-
Punctuation marks: ,, ;, ., !, ?, -, _, etc.
-
Special characters: @, #, %, ^, &, *, =, \t (for the tab character, use \t when specifying the delimiter; pressing the Tab key will not work).
While most common characters are supported as delimiters, some symbols may be excluded from the list due to specific command behavior. -
-
To perform mathematical calculations, all values in the array must be numeric. If there are any non-numeric values, the command will return an empty result in the specified variable. Use the Check type command beforehand to ensure that all elements in the array are numeric.