Get values from an array using map

I am trying to get the value form an array. In this example I want to get “Bob’s building” where the “field_id” is “Contract_ClientName”

            "value": "Bob's building",
            "field_id": "Contract_ClientName"

Here is the full array from my aggregator:

[
    {
        "array": [
            {
                "value": "19",
                "field_id": "Contract_EnterDay"
            },
            {
                "value": "March",
                "field_id": "Contract_EnterMonth"
            },
            {
                "value": "Bob'sbuilding",
                "field_id": "Contract_ClientName"
            },
            {
                "value": "123 Runway lane",
                "field_id": "Contract_Client Address"
            },
            {
                "value": {},
                "field_id": "Initials1"
            },
            {
                "value": {},
                "field_id": "Initials1_1"
            },
            {
                "value": "123@abc.ca",
                "field_id": "Contract_manager email_1"
            },
            {
                "value": {},
                "field_id": "Initials1_1_1"
            },
            {
                "value": {},
                "field_id": "SignatureClient"
            },
            {
                "value": {},
                "field_id": "SignatureSnowpros"
            }
        ],
        "__IMTAGGLENGTH__": 10
    }
]

I tried using map but it is throwing an error

{{map(3.array[].value; "Contract_ClientName"; "field_id"; 3.array[].value)}}

blueprint (5).json (6.1 KB)

Any ideas?

Hi @Shawn
you can try this out:

output:
image

If you require additional assistance, please don’t hesitate to reach out to us.
MSquare Support
Visit us here
Youtube Channel

4 Likes

That worked. Thank you. I finished it with a Get()

{{get(map(3.array; “value”; “field_id”; “Contract_ClientName”); 1)}}

3 Likes

If you want to get the first item, you can also use the built-in function first

e.g.:

{{ first(map(3.array; "value"; "field_id"; "Contract_ClientName")) }}

For more information, see https://www.make.com/en/help/functions/array-functions.html#first--array-

3 Likes