Goal: Extract the first ID from the array, which is "22342".
Why Option B is Correct:
The expressionget(map(2.Colors; ID); 1):
map(2.Colors; ID): Iterates over the array 2.Colors and extracts the ID field from each object. This creates a new array containing just the IDs:["22342", "33495"].
get(...; 1): Retrieves the first element of the newly created array, which is "22342".
Why the Other Options are Incorrect:
Option A (map(2.Colors; ID; ID; 1)):
This syntax is invalid because the additional ID and 1 parameters are misplaced. The map function requires only two arguments: the array and the field to map.
Option C (map(get(2.Colors; ID); 1)):
This incorrectly attempts to use get inside map. The get function does not return a field for mapping, so the syntax is invalid.
How the Expression Works:
Step 1: map(2.Colors; ID)
Extracts the ID field from each object in the Colors array.
Output: ["22342", "33495"].
Step 2: get(...; 1)
Retrieves the first element of the mapped array.
Output: "22342".
Use Case in Workfront Fusion:
This approach is commonly used when processing arrays in Fusion scenarios, ensuring specific elements are accessed without additional looping or complex logic.
References and Supporting Documentation:
Adobe Workfront Fusion Functions Documentation
Workfront Community: Using Map and Get Functions
By combining map and get, this expression efficiently extracts the first ID from the array, ensuring correct and reliable results.
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit