Set variable producing empty collections

The output of my HTTP module (parse JSON option selected) is a complex array with nested arrays and collections. (see screenshots) … I am trying to just get an array of the “text:”. I tried using Set Variable but all I get is an array of empty collections.


@Dylan_Peterson
Hi, can you paste the raw data of the HTTP module so I can try it in my environment?

Welcome to the Make community!

You can use the built-in function map

e.g.:

{{ map(7.data; "words.1.text") }}

For more information, see the function documentation in the Help Center and do the tutorials in the Make Academy.

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

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

Thanks for the offer to help. Here is the output. I just included from “data” on down. It could be that that there’s an extra bracket at the end.
HTTP output.txt (2.6 KB)

OMG! That worked. I swear I tried that before, but whatever. I’m so happy to have that simple solution.

Can you answer a couple of small related questions to this?

  1. Why did you suggest a solution starting and ending with {{ }}?
  2. How come when I copied and pasted your solution Make automatically removed {{}} as well as the quotations? But it still worked.
1 Like

That’s how Make IML are represented when copied out from the module fields. Try it yourself.

So when you paste it back in, the IML is converted back to how you are used to it.

For more information, see Autocomplete Commonly-Used Functions in IML (Mapping) Fields!

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

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

1 Like