Need help selecting a value from an array

I have data sorted from an xml file that I am parsing on Make. I need to search through the survey_data array collection for an id matching ‘gender’ containing a _value of ‘1’ and if matched, the value returned should be the prompt value.

Here is a screenshot of precisely what I am trying to achieve:

Scratching my head on how to do this due to the way it’s nested.
Here is the output bundle from the parse XML to see the same:

[
    {
        "breeze_systems_photobooth": {
            "_attributes": {
                "version": "3.20.1",
                "app": "DSLR Remote Pro for Windows",
                "id": "76aac7c38041a0b4f18d86107",
                "name": "DESKTOP"
            },
            "event": [
                {
                    "_attributes": {
                        "id": "eace807208b9da1300b6137fd",
                        "eventkitegalleryid": null
                    },
                    "eventName": [
                        ""
                    ],
                    "eventString": [
                        {
                            "_attributes": {
                                "id": 1
                            }
                        },
                        {
                            "_attributes": {
                                "id": 2
                            }
                        },
                        {
                            "_attributes": {
                                "id": 3
                            }
                        },
                        {
                            "_attributes": {
                                "id": 4
                            }
                        },
                        {
                            "_attributes": {
                                "id": 5
                            }
                        }
                    ]
                }
            ],
            "photo_information": [
                {
                    "date": [
                        "2024/03/13"
                    ],
                    "time": [
                        "18:44:03"
                    ],
                    "user_data": [
                        "emailhere"
                    ],
                    "survey_data": [
                        {
                            "survey3_chkbox1": [
                                {
                                    "_value": 1,
                                    "_attributes": {
                                        "id": "gender",
                                        "prompt": "Male"
                                    }
                                }
                            ],
                            "survey3_chkbox2": [
                                {
                                    "_value": "0",
                                    "_attributes": {
                                        "id": "gender",
                                        "prompt": "Female"
                                    }
                                }
                            ],
                            "survey3_chkbox3": [
                                {
                                    "_value": "0",
                                    "_attributes": {
                                        "id": "gender",
                                        "prompt": "Nonbinary"
                                    }
                                }
                            ]
                        }
                    ],
                    "uid": [
                        "MEJ37459"
                    ],
                    "uid2": [
                        "KPTFG883"
                    ],
                    "uid3": [
                        "JTE796XWE"
                    ],
                    "eventkitesessionid": [
                        "DXF335XZK"
                    ],
                    "prints": [
                        1
                    ],
                    "photobooth_images_folder": [
                        "D:\\OneDrive\\Documents\\PhotoboothImages\\Dell"
                    ],
                    "download_folder": [
                        "D:\\OneDrive\\Documents\\PhotoboothImages\\2024-03-13"
                    ],
                    "digital_zoom": [
                        100
                    ],
                    "mirror_output": [
                        "0"
                    ],
                    "greenscreen": [
                        "0"
                    ],
                    "saveCopyOfProcessedPhotos": [
                        1
                    ],
                    "camera_orientation": [
                        "0"
                    ],
                    "bw_mode": [
                        "0"
                    ],
                    "photos": [
                        {
                            "photo": [
                                {
                                    "_value": "164920.JPG",
                                    "_attributes": {
                                        "image": 1,
                                        "md5": "5371291836317d1e54e6ebb1c20"
                                    }
                                }
                            ],
                            "processed": [
                                {
                                    "photo": [
                                        {
                                            "_value": "processed\\164920.JPG",
                                            "_attributes": {
                                                "image": 1,
                                                "md5": "089c7503ffc748e13e1ed6b0cff"
                                            }
                                        }
                                    ]
                                }
                            ],
                            "output": [
                                {
                                    "_value": "prints\\240313_184403.jpg",
                                    "_attributes": {
                                        "md5": "c99b8c8ed398ff54dbc74c7f55b"
                                    }
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    }
]

Welcome to the Make community!

Please provide the output bundles of the module shown in your screenshot above 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”.
Screenshot_2023-10-06_141025

A.

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

Uploading them here will look like this:

module-1-input-bundle.txt (12.3 KB)
module-1-output-bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles 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 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!

2 Likes

Bundle markdown added.

Hi @mgbernier

Please use map function like this :point_down: for each checkbox array inside collection of survey data and then you can use get function to get function to get each of the element of array by their position:

Please refer to this document:
https://www.make.com/en/help/mapping/mapping-arrays#mapping-an-array-s-element-with-a-given-key

If you require additional assistance, please don’t hesitate to reach out to us.
MSquare Support
Visit us here
Youtube Channel

2 Likes