Take only one value from an array

Hello makers! Need a bit of help with taking one value from an array.

This is the data in the array, and I only need to take the 2nd value and carry it over the whole scenario, but the value I want to take isn’t always in the 2nd value, it’s sometimes in the 3rd, 4th etc. And the number of values in the array also differs.

I was thinking I can set a condition to measure the length of each value in that array and take the shortest one (It’s always going to be the shortest one, but I’m not sure how the logisitics would work for that. Need help, thank you!

1 Like

Hi @Multiply_Advisors

You will need to iterate the array and then use numeric aggregator and select the minimum value.

Regards,
Msquare Automation - Platinum Partner of Make
@Msquare_Automation

1 Like

@Msquare_Automation, Does the minimum value check only for the length of the string ? What happens if one of the values is an actual number, but greater length than every other string ?

1 Like

Hey @kudracha

We suggested this as you mentioned - “(It’s always going to be the shortest one, )”

If it can be any length, then you should analyse the pattern and find something unique that other’s value can have but not the one you need.

Regards,
Msquare Automation - Platinum Partner of Make
@Msquare_Automation

@Msquare_Automation, Hm I think you misunderstood. I’m just curious about how ‘minimum value’ works - does this check min. length of a string in an array or a minimum value (numerical) in an array? I assume this solution works for min. length, but what if there are numbers (numerical var) in the array, too?

1 Like

This works with numbers. That’s why we suggested to use length() function while mapping the value from iterator inside aggregator. @kudracha

Regards,
Msquare Automation - Platinum Partner of Make
@Msquare_Automation

@Msquare_Automation Oh okay, don’t see length() function mentioned anywhere in the topic. I missed that part and thought it was weird. :slight_smile:

Welcome to the Make community!

If you need further assistance, please provide the following:

Output Bundles of Modules

Please provide example output bundles of the modules by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.

A. Upload as Text File

Save each bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

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 even if they do not use the external service.

By providing these details, it will allow others to assist you better.