Unable to choose variable from header response

Dear All,
see the following screenshot. I am sending a command to upload a file, and the response is 201 - the media-path is stored in the header response, part 3 as you can see on the left side. I now need this part in the next step to attach this file to an asset container - but as you can see, I am unable to see the variable for it. How can I still access this information, what do I have to enter here in the second screenshot, where the XXXX is shown?

Best,
Tom

You can use the built-in functions map and get to access variables within an array.

To do this, you can use the built-in function map —

{{ map(complex array; key; [key for filtering]; [possible values for filtering separated by a comma]) }}

and the built-in function get (or first) —

{{ get(object or array; path) }}

so you get something that looks like this —

{{ first(map(1.array; "value"; "name"; "content-type")) }}

(copy-paste the above into the field, or type it exactly as shown)

You can also combine map and join to combine the variables within an array into a single text string —

{{ join(array; delimiter) }}

For more information, the function’s documentation can be found in the Help Centre and the “Mapping with Arrays” link below. You should also complete the tutorials in the Make Academy, especially Using get() and map() functions.

Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —

Getting Started

  • Help Centre | Tutorials – Make “Manual” - search for help here first
  • Make Academy – Basics 101: Learn Make properly to get your money’s worth

Help Centre Basics

Articles & Videos

Hope this helps! Let me know if there are any further questions or issues.

— @samliew

Hello, @samliew I did as you said, but the file wont be linked. If I manually add the local path (eg. “0/1/6/4/0164f4e62c699f2a78fc2efea90b2ff514471277.pdf” it works

Here is how I did this. Anything wrong?

P.S: Copying " " always removes them in the field - is this intended?

You should not be using double quotes in the function parameters.

You either copy-paste the whole line exactly as this including the {{ }} brackets,

{{ first(map(1.array; "value"; "name"; "content-type")) }}

(copy-paste the above into the field, or type it exactly as shown)

or you type it this way (from scratch in an empty field, or select the functions from the variables panel)

first(map(array; value; name; content-type))

Hope this helps! Let me know if there are any further questions or issues.

— @samliew

1 Like

Thank you!! I got it all working now

1 Like

No problem, glad I could help you with “Unable to choose variable from header response”

1. If anyone has a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help as newer questions are displayed higher on the forum’s “new” page.

2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.

This marks the topic as solved, so that:

  • others can save time when catching up with the latest activity here, and
  • allows others to quickly jump to the solution if they come across the same problem

To do this, simply click the checkbox at the bottom of the post that answers your question:
Screenshot_2023-10-04_161049

3. Don’t forget to like and bookmark this topic so you can get back to it easily in future!

Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —

Getting Started

  • Help Centre | Tutorials – Make “Manual” - search for help here first
  • Make Academy – Basics 101: Learn Make properly to get your money’s worth

Help Centre Basics

Articles & Videos

Hope this helps! Let me know if there are any further questions or issues.

— @samliew