Assitance with map( ; ; ;)

Can anyone please help me with the mapping issue I’m having. If I do
map(48.body.value; “id”) results are returned, but when I go into the next level of fields to compare the Title with a the Title brought back from a different module, I get a blank “” returning.

To clarify, I want to return the ID where Title matches Display number.

Thanks in advance for any help.

why do you need the fields() around the name of the keys? If you can show the output data structure of module 48 that can help. Just select the output bundle and download it in the output bubble and copy and paste it here.

The usual map is

map(array-reference;key-to-extract;key-to-filter;value-to-filter)

The 2 and 3rd arguments are raw fields which can be extracted by looking at the data structure of the array-reference array. And the value to filter needs to be the raw name as well.

ps. This question is repeated in various forms all over the community. If I had a dime for every time someone had a problem learning map(), well I would have more than a few thousand bucks.

3 Likes

what alex says is correct, if the id e.g is nested in the fields array you would need a nested map function or an iterator

without providing the output bundle it wont be possible to help out

3 Likes

Thanks for the reply both, I’ve attached a screenshot of the output

Welcome to the Make community!

Please provide the 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 output bundles”.
Screenshot_2023-10-06_141025

A.

Save the bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.
Uploading it here will look like this:

bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted output bundle in this manner:

  • Either add three backticks ``` before and after the code, like this:

    ```
    input/output bundle content goes here
    ```

  • Or use the format code button in the editor:
    Screenshot_2023-10-02_191027

Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

This will allow others to better assist you. Thanks!

2 Likes

i cant see a value in your output bundle with the name “display number” but try the following

map({{48.body:value}};id;Title;{{19.Display Number}})

2 Likes

Figured it out. Thanks for the help.

{{map(48.body.value; “id”; “fields.Title”; 19.display_number)}}

3 Likes

Hey @MPLC :wave:

Awesome to hear that you managed to get this up and running with the assistance of the community :clap:

Thanks a lot for keeping us updated about your progress :muscle:

1 Like