Set Variable

Hello, how can I output the highlighted result using a Set Variable module?
Thank you in advance for your help!

3 Likes

Do you want to have the value of the first child of the array only?

1 Like

Only of the Contact attribute value, in this case " Angebot erstellt"

1 Like

is it always one value in the Array? as i can tell, the contact attribute value is an array, so it may contain multiple values.

1 Like

yes, always one value

1 Like

Alright, this may not be the answer you’re looking for—I’m just trying to brainstorm the situation with you. :slightly_smiling_face:
At the top, you have several bundles (Bundle 1). Each bundle has (I assume) one Array. Each of those Arrays has one collection. Each collection contains a contact collection that holds the contact attributes array. This array contains several collections, and each of those holds an array (the contact attribute values).

More visual structure:

  • Top of the bundle (pos. 0)
  • Bundle (pos. 1)
    • Array (pos. 2)
      • Collection (contact) (pos. 3)
        • Array (contact attributes) (pos. 4)
          • Collection (pos. 5)
            • Array (contact attribute values) (pos. 6)

Now, what I would do in this case is have an iterator running on top of the bundle (pos. 0), followed by another iterator on the contact attributes (pos. 4).


How does this work?

Depending on your case, the top of the bundle may contain several bundles, so you may need to go through all of them. (If not, you can skip the first iterator.)
Since the Bundle (pos. 1) is a collection that contains an Array (where your target data is), you don’t need to iterate over the bundle itself—we know exactly where the data is.

Going one level down to the Array (pos. 2):
In your case, each array (I assume) has only one item, so we don’t need to iterate—it’s safe to move forward and select the first item directly.

Going down to the contact collection (pos. 3):
Since we only need the contact attributes, we can skip iteration here as well.

Going to the contact attributes array (pos. 4):
This array contains multiple collections. Each of these collections contains (I assume) a contact attribute value that holds the actual data we want. So, we need to iterate this level to extract all the contact attribute values.


Lange Rede, kurzer Sinn – What needs to be done?

You need to:

  1. Depending on your case, iterate through the array of bundles (pos. 0)
  2. Iterate through the contact attributes (pos. 4)
  3. Capture (set variable or whatever you need) the data

I’ve created a similar scenario with input data like yours (copied from your screenshot). Here’s how it looks:

I have created a similer scenario with similer input data as yours (copied from your screenshot).
Here how it looks like:





Be Caution:
If you Iterate and try to write to a variable, it will replace the old value on each run. So writing to variable is not the best thing you can do.

1 Like

If your first module is an instant module that is set to run immediately, then you do not need to aggregate into an array.

Could you provide a screenshot of your scenario?

Hello, here is the Screenshot of the Automation

1 Like

and can you delete the array aggregator, and provide the output bundle of the trigger module [1]?

Please provide the output bundles of each of the relevant modules by running the scenario (you can also get this without re-running your scenario from the History tab).

Click on the white speech bubbles on the top-right of each module and select “Download input/output bundles”.

A. Upload as a Text File

Save each bundle contents in a plain text editor (without formatting) as a bundle.txt file.

You can upload the file here by clicking on this button:

B. Insert as Formatted Code Block

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles.
These are the two ways to format text so that it won’t be modified by the forum:

  • Method 1: Type code block manually

    Add three backticks ``` before and after the content/bundle, like this:

    ```
    content goes here
    ```

  • Method 2. Highlight and click the format button in the editor

Providing the input/output bundles will allow others to replicate what is going on in the scenario, especially if there are complex data structures (nested arrays and collections) or if external services are involved, and help you with mapping the raw property names from collections.

This will allow others to better assist you. Thanks!

— @samliew

Here I need for example " Warten auf Unterlagen "
1.txt (3.2 KB)

Just use the get( ) function to extract the 1st item of the array.