Extract value from a collection based on another collection within the same bundle

Hello,

I have a main collection called Services, in which I have 3 nested collections Service / Total Amount / Dates

I would like to retrieve the item Service Date, based on the Code REFRESH. But Service Date & Code are not on the same collection, so I feel I cannot use the map(map…

Can someone help me?

"services": [
            {
                "service": {
                    "id": "DE_BE_004-BIKE",
                    "code": "BIKE",
                    "name": "Bike",
                    "description": "Bike",
                    "pricingUnit": "Person",
                    "defaultGrossPrice": {
                        "amount": 20,
                        "currency": "EUR"
                    }
                },
                "totalAmount": {
                    "grossAmount": 60,
                    "netAmount": 50.43,
                    "vatType": "Normal",
                    "vatPercent": 19,
                    "currency": "EUR"
                },
                "dates": [
                    {
                        "serviceDate": "2024-10-08",
                        "count": 1,
                        "amount": {
                            "grossAmount": 20,
                            "netAmount": 16.81,
                            "vatType": "Normal",
                            "vatPercent": 19,
                            "currency": "EUR"
                        },
                        "isMandatory": false
                    },
                    {
                        "serviceDate": "2024-10-09",
                        "count": 1,
                        "amount": {
                            "grossAmount": 20,
                            "netAmount": 16.81,
                            "vatType": "Normal",
                            "vatPercent": 19,
                            "currency": "EUR"
                        },
                        "isMandatory": false
                    },
                    {
                        "serviceDate": "2024-10-10",
                        "count": 1,
                        "amount": {
                            "grossAmount": 20,
                            "netAmount": 16.81,
                            "vatType": "Normal",
                            "vatPercent": 19,
                            "currency": "EUR"
                        },
                        "isMandatory": false
                    }
                ]
            },   
{
                "service": {
                    "id": "DE_BE_004-REFRESH",
                    "code": "REFRESH",
                    "name": "Room Refresher",
                    "description": "Room Refresher",
                    "pricingUnit": "Room",
                    "defaultGrossPrice": {
                        "amount": 10,
                        "currency": "EUR"
                    }
                },
                "totalAmount": {
                    "grossAmount": 30,
                    "netAmount": 30,
                    "vatType": "Without",
                    "vatPercent": 0,
                    "currency": "EUR"
                },
                "dates": [
                    {
                        "serviceDate": "2024-10-07",
                        "count": 1,
                        "amount": {
                            "grossAmount": 10,
                            "netAmount": 10,
                            "vatType": "Without",
                            "vatPercent": 0,
                            "currency": "EUR"
                        },
                        "isMandatory": false
                    },
                    {
                        "serviceDate": "2024-10-08",
                        "count": 1,
                        "amount": {
                            "grossAmount": 10,
                            "netAmount": 10,
                            "vatType": "Without",
                            "vatPercent": 0,
                            "currency": "EUR"
                        },
                        "isMandatory": false
                    },
                    {
                        "serviceDate": "2024-10-09",
                        "count": 1,
                        "amount": {
                            "grossAmount": 10,
                            "netAmount": 10,
                            "vatType": "Without",
                            "vatPercent": 0,
                            "currency": "EUR"
                        },
                        "isMandatory": false
                    }
                ]
            }
        ],

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 input/output bundles”.

A. Upload as Text File

Save each bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

B. Insert as Formatted Code Block

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles.
These are the two ways to format text so that it won’t be modified by the forum:

  • Method 1: Type code block manually

    Add three backticks ``` before and after the content/bundle, like this:

    ```
    content goes here
    ```

  • Method 2. Highlight and click the format button in the editor

Providing the input/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!

Hope this helps! Let me know if there are any further questions or issues.
Note: I see hundreds of posts, notifications, and messages daily on this forum, so if I missed your reply, please message me to look at your reply.

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!