Expand my Community achievements bar.

Do you have questions about the migration to Adobe Business Platform? Come join our upcoming coffee break and ask away!

'Add Item to Array Variable' function in Tools section

Avatar

Level 5

1/24/21

It would be really useful to have a function to add an item to an array variable. This should allow you to enter the name of an array variable (or even better, select it from a list) and provide the item input (string or object) and Fusion would add it to the list. There should be no need to provide the existing array contents as an input to the function like there is now with 'Set Variable'.


This new function would save the repetition (especially within an iterator) of getting the variable then setting the variable again over and over. This would reduce Fusion operations and UI/config clutter.

3 Comments

Avatar

Level 4

12/9/23

This is something I'm trying to work out now. 

I'm iterating through groups and adding access rules to an array when the groups need adding. 

What is your current workaround @DavidCornwellLP ? I can't currently figure out how to append to an array using get/set variables.

Rob

Avatar

Level 5

12/10/23

Hi @RobertDy,

There's several options actually:

  1. You can do a pattern where you do a Get Variable, followed by a Set Variable. In the Set module you can do an Add or some other array functions. This is not the most efficient method, especially if you are iterating through a large array, because you are getting the same data over and over again so it uses more memory than it should.  The proposed enhancement should ideally be a more efficient combination of this method and the one in the next point.
  2. Using an Array Aggregator is the ideal method, so you just iterate through and aggregate objects or strings (including JSON strings). It's a little more complicated but when you get the hang of it it is a good way to go.
  3. Using a Text Aggregator is another option if you're working with strings or JSON text.

Hope this helps.  If you are ever looking for assistance with Fusion implementations/optimisation/support please feel free to reach out to LeapPoint where I am part of the Integrations team. www.leappoint.com 

 

Regards,

 

David Cornwell
LeapPoint

Avatar

Level 4

12/11/23

Thank you @DavidCornwellLP 

I think I got something working using the array aggregator. I must say, it's not very intuitive. But it's now working.

Rob