Get value from array

I’m using the HTTP Make a request in my scenario and it returns the following JSON

    "data": {
        "customerProfileId": "1015758863",
        "customerPaymentProfileIdList": [
            "1025779565"
        ]

In order to use 1015758863 I simple use {{11.data.customerProfileId}} but that doesn’t work for 1025779565 since it’s in an array. What code would I need to use 1025779565?

Thank you for your assistance.

Welcome to the Make community!

You can use the built-in function first() to retrieve an array’s first value:

{{first(11.data.customerProfileIdList)}}
2 Likes

Hello @wra

Or you can specify the index of that value within the array to access it. In your case, to access “1025779565,” which is inside the “customerPaymentProfileIdList” array, you should use the array index like this: {{11.data.customerPaymentProfileIdList[0]}}

Don’t hesitate to contact us if you require further assistance.
//VLAD

1 Like