Map an array or array element

An array is a bundle item that can contain the following:

  • One or more values of the same type (simple array)
  • One or more collections of the same type (complex array)
recommendation-more-help

Example:

  • Complex array: The Watch emails module returns an array of attachments for every email. Every attachment represents a collection that may contain a name, content, size, and so on.

Access requirements

Expand to view access requirements for the functionality in this article.

You must have the following access to use the functionality in this article:

table 0-row-2 1-row-2 2-row-2 3-row-2 layout-auto html-authored no-header
Adobe Workfront package Any
Adobe Workfront license

New: Standard

Or

Current: Work or higher

Adobe Workfront Fusion license**

Current: No Workfront Fusion license requirement.

Or

Legacy: Any

Product

New:

  • Select or Prime Workfront plan: Your organization must purchase Adobe Workfront Fusion.
  • Ultimate Workfront plan: Workfront Fusion is included.

Or

Current: Your organization must purchase Adobe Workfront Fusion.

For more detail about the information in this table, see Access requirements in documentation.

For information on Adobe Workfront Fusion licenses, see Adobe Workfront Fusion licenses.

Map an entire array

  1. Click the Scenarios tab in the left panel.

  2. Select the scenario where you want to map an array.

  3. Click anywhere on the scenario to enter the Scenario editor.

  4. In the module that you want to map the array to, click the field where you want to map the array. This is the field that the array is mapped to.

  5. In the box that displays, map the item.

    The panel allows you to map fields in the same way as with any other type of item. If you do not want to fill in each item separately, but want to map another array into the target field, use the Map button. In this case, make sure that both arrays (the source array and the target array) have the same structure.

    You can add any number of items to an array.

You can divide an array into individual bundles using an iterator. Fore more information, see Iterator module in Adobe Workfront Fusion.

Map items into a new array

Some fields in Workfront Fusion allow you to map elements into an array. For example, you can create an array of checklist items into the Workfront Boards > Add checklist item module. When the module is run, all of the checklist items are added to the card.

Any module field that displays “Add item” creates an array.

Add item

To add elements to the array:

  1. Click Add item
  2. In the panel that opens, enter details about the item.
  3. Click Add.
  4. (Optional) Repeat steps 1-3 for each element you want to add to the array.

Map array elements

Map array elements by number

Array elements display as a number in square brackets after the array name. You can map an individual element of an array into a field by using this index number.

Map first element

NOTE
Array indexing in Workfront Fusion starts from 1.

To map an array element:

  1. Click the field where to you want to map the element.

    The mapping panel opens.

  2. Locate the array that contains the element you want to map.

  3. Click the dropdown arrow next to the array.

  4. Click the element that you want to map.

    The element is mapped, with the index of 1. This maps the first element in the array.

  5. To map a different element of the array, click on the [1] and enter the index number of the array element that you want to map.

    Access another element

Map an array’s element with a given key

Some arrays contain collections with key-value items such as metadata, attributes, and so on. To use one of these values, you can look up an element by its given key value and obtain the corresponding value from the value item. We recommend using a formula employing a combination of the map() and get() functions.

The following example shows the output of the Jira App.

Output of Jira module

This example gets a file name from an array of attachments, for the specific attachment with an ID of 10108.

This example generates the following output:

Output of Jira module

The formula can be explained as follows:

  • map

    1. The first parameter of the map() function is the whole array item.

    2. The second parameter is the raw name of the value item. To obtain the raw name, hover over the item in the mapping panel:

      Obtain raw name

      note note
      NOTE
      All parameters are case sensitive. Even though in this particular example the item’s label differs from its raw name only in capitalization, it is necessary to use the raw name.
    3. The third parameter is the raw name of the key item:

      Third parameter

    4. The fourth parameter is the given key value.

    Because the map() function returns an array (as there could be more elements with the given key value), it is necessary to apply the get() function to get its first element:

  • get

    1. The first parameter of the get() function is the result of the map() function.

    2. The second parameter is the element’s index. In this exammple, the index is 1.

This example generates the following output:

Output from Jira module

For more information about the map() function, see Array functions.

For more information about the get() function, see General functions.

Convert array elements to a series of bundles

Arrays can be converted to a series of bundles using the Iterator module. For more information, see Iterator module.

Series of bundles

7e1891ad-4d59-4355-88ab-a2e62ed7d1a3