How to isolate one item of a bundle with the value of another item

You really don’t need to use an iterator unless you plan to actually run an operation on each part of the array you are iterating. If your array has more than one element the modules after the iterator will run as many times as the number of elements in an array.

Here’s a little test scenario so you can see various mechanisms to access parts of a 2 element array.

Here’s the 2 element array we are testing with:

[
    {
        "name": "Alex C",
        "age": 53,
        "city": "Toronto"
    },
    {
        "name": "Eric S",
        "age": 43,
        "city": "Hoboken"
    }
]

And here’s the scenario were the set multiple variables works on grabbing various elements in different ways:

and the output bundle

Output Bundle to show results

Copy and paste this scenario blueprint into a new scenario to play around:
    "subflows": [
        {
            "flow": [
                {
                    "id": 1,
                    "module": "json:ParseJSON",
                    "version": 1,
                    "parameters": {
                        "type": ""
                    },
                    "mapper": {
                        "json": "[\n    {\n        \"name\": \"Alex C\",\n        \"age\": 53,\n        \"city\": \"Toronto\"\n    },\n    {\n        \"name\": \"Eric S\",\n        \"age\": 43,\n        \"city\": \"Hoboken\"\n    }\n]"
                    },
                    "metadata": {
                        "designer": {
                            "x": 0,
                            "y": 0
                        },
                        "restore": {
                            "parameters": {
                                "type": {
                                    "label": "Choose a data structure"
                                }
                            }
                        },
                        "parameters": [
                            {
                                "name": "type",
                                "type": "udt",
                                "label": "Data structure"
                            }
                        ],
                        "expect": [
                            {
                                "name": "json",
                                "type": "text",
                                "label": "JSON string",
                                "required": true
                            }
                        ]
                    }
                },
                {
                    "id": 2,
                    "module": "builtin:BasicAggregator",
                    "version": 1,
                    "parameters": {
                        "feeder": 1
                    },
                    "mapper": {
                        "name": "{{1.name}}",
                        "age": "{{1.age}}",
                        "city": "{{1.city}}"
                    },
                    "metadata": {
                        "designer": {
                            "x": 300,
                            "y": 0
                        },
                        "restore": {
                            "extra": {
                                "feeder": {
                                    "label": "JSON - Parse JSON [1]"
                                },
                                "target": {
                                    "label": "Custom"
                                }
                            }
                        }
                    }
                },
                {
                    "id": 3,
                    "module": "util:SetVariables",
                    "version": 1,
                    "parameters": {},
                    "mapper": {
                        "variables": [
                            {
                                "name": "get first array element",
                                "value": "{{get(2.array; 1)}}"
                            },
                            {
                                "name": "city of second array element",
                                "value": "{{get(2.array; \"2.city\")}}"
                            },
                            {
                                "name": "get age from first array element using pick",
                                "value": "{{pick(get(2.array; 1); \"age\")}}"
                            },
                            {
                                "name": "all cities from each array element using map",
                                "value": "{{map(2.array; \"city\")}}"
                            }
                        ],
                        "scope": "roundtrip"
                    },
                    "metadata": {
                        "designer": {
                            "x": 600,
                            "y": 0
                        },
                        "restore": {
                            "expect": {
                                "variables": {
                                    "items": [
                                        null,
                                        null,
                                        null,
                                        null
                                    ]
                                },
                                "scope": {
                                    "label": "One cycle"
                                }
                            }
                        },
                        "expect": [
                            {
                                "name": "variables",
                                "type": "array",
                                "label": "Variables",
                                "spec": [
                                    {
                                        "name": "name",
                                        "label": "Variable name",
                                        "type": "text",
                                        "required": true
                                    },
                                    {
                                        "name": "value",
                                        "label": "Variable value",
                                        "type": "any"
                                    }
                                ]
                            },
                            {
                                "name": "scope",
                                "type": "select",
                                "label": "Variable lifetime",
                                "required": true,
                                "validate": {
                                    "enum": [
                                        "roundtrip",
                                        "execution"
                                    ]
                                }
                            }
                        ],
                        "interface": [
                            {
                                "name": "get first array element",
                                "label": "get first array element",
                                "type": "any"
                            },
                            {
                                "name": "city of second array element",
                                "label": "city of second array element",
                                "type": "any"
                            },
                            {
                                "name": "get age from first array element using pick",
                                "label": "get age from first array element using pick",
                                "type": "any"
                            },
                            {
                                "name": "all cities from each array element using map",
                                "label": "all cities from each array element using map",
                                "type": "any"
                            }
                        ]
                    }
                }
            ]
        }
    ],
    "metadata": {
        "version": 1
    }
}```

Thanks Alex, I’ll take a look at that.

On another topic. When I use the text replace module (to remove > characters in a string) it seems to intermittently replace them with ‘null’.

Is there anyway to make this consistently delete?

Can you start a new thread instead of continuing this one so more people would have eyes on this new question?

Oops sorry, done, thanks