Comparing an orderindex into multiple array collections

Hello there !

This is my first post, so I don’t know if it will be very clear, or if the title is clear enough or not. But what I’ve been trying to do for a few days is to get a list of subtasks for a task, clickups, to put them in an aggregator, and then to get only the first task of this milestone task to then send an email to the person concerned.

The way I thought to do this is to make the list of subtasks for the milestone task, put them in the aggregator in custom mode and use the index order by comparing them with a set variable to define what was the smallest index order and therefore what was the first task of the subtasks.

Except that I encounter a lot of different problems and being a beginner with Make, I have trouble understanding where the problems come from. I tried to do a lot of research, I’ve been doing this for several days, but I have no choice but to do a job because I never find an answer to the specific problem I have. There are good chances that it has already been answered and that I just didn’t do the right research, especially on the forum, but I imagine that we will be told if that is the case.

At first, the problem I encountered was that my variable only calculated the smallest index order on the first array collection that my array aggregator was giving me. So it was always the same thing that came back. It was not the subtask that I was looking for, it was just the first one collection of the array.

While doing some research, especially on the forum, I came across the variable “toCollection” that I put in an iterator And it gave me all the IDs and all the orderindex’s in JSON format. But whether it was by directly doing the array aggregator to the set variable or by doing array aggregator, iterator and set variable, it didn’t work. The major problem I encounter when doing array aggregator to this variable is that I often have formulas that are not detected by make. I don’t know if it’s because they don’t exist or something else, but for example, everything that will be filtered that I tried to replace by select or by where they are not detected, it is just plain text.

All I’m trying to do is to get the smallest index order, then link it with its ID, then send the mail to the right person with the right information, the right tasks per mail. That’s all I’m trying to do, but I can’t. I will put more documentation with more context below on my self-meditation and so on. And I thank all the people who will try to help me.

I didn’t put a formula screen in this variable because it’s useless, I didn’t find any that works so now it’s empty because I can’t do what I want to do so now the module is empty…

The output bundle of the aggregator is (All the tasks’ IDs seem to be the same, it’s because I removed the end, I was asked to anonymize) :

[
    {
        "array": [
            {
                "id": "86977",
                "url": "https://app.clickup.com/t/86977",
                "name": "Prépa & Timeline Sound Design",
                "status": {
                    "status": "staffing",
                    "id": "sc901206881156_8OJW5VI9",
                    "color": "#87909e",
                    "type": "open",
                    "orderindex": 0
                },
                "creator": {
                    "id": 164437448,
                    "username": "Ulysse",
                    "color": "",
                    "email": "mail@mail.com",
                    "profilePicture": null
                },
                "assignees": [],
                "orderindex": "39745222.50000000000000000000000000000000",
                "description": "",
                "__IMTINDEX__": 13,
                "__IMTLENGTH__": 20
            },
            {
                "id": "86977",
                "url": "https://app.clickup.com/t/86977",
                "name": "Prépa & Timeline VFX",
                "status": {
                    "status": "staffing",
                    "id": "sc901206881156_8OJW5VI9",
                    "color": "#87909e",
                    "type": "open",
                    "orderindex": 0
                },
                "creator": {
                    "id": 164437448,
                    "username": "Ulysse",
                    "color": "",
                    "email": "mail@mail.com",
                    "profilePicture": null
                },
                "assignees": [],
                "orderindex": "39745221.50000000000000000000000000000000",
                "description": "",
                "__IMTINDEX__": 14,
                "__IMTLENGTH__": 20
            },
            {
                "id": "86977",
                "url": "https://app.clickup.com/t/86977",
                "name": "Prépa & Timeline Etalonnage",
                "status": {
                    "status": "staffing",
                    "id": "sc901206881156_8OJW5VI9",
                    "color": "#87909e",
                    "type": "open",
                    "orderindex": 0
                },
                "creator": {
                    "id": 164437448,
                    "username": "Ulysse",
                    "color": "",
                    "email": "mail@mail.com",
                    "profilePicture": null
                },
                "assignees": [],
                "orderindex": "39745220.50000000000000000000000000000000",
                "description": "",
                "__IMTINDEX__": 15,
                "__IMTLENGTH__": 20
            },
            {
                "id": "86977",
                "url": "https://app.clickup.com/t/86977",
                "name": "Prépa & Timeline Montage",
                "status": {
                    "status": "staffing",
                    "id": "sc901206881156_8OJW5VI9",
                    "color": "#87909e",
                    "type": "open",
                    "orderindex": 0
                },
                "creator": {
                    "id": 164437448,
                    "username": "Ulysse",
                    "color": "",
                    "email": "mail@mail.com",
                    "profilePicture": null
                },
                "assignees": [],
                "orderindex": "39745219.50000000000000000000000000000000",
                "description": "",
                "__IMTINDEX__": 16,
                "__IMTLENGTH__": 20
            },
            {
                "id": "86977",
                "url": "https://app.clickup.com/t/86977",
                "name": "Sound Design",
                "status": {
                    "status": "staffing",
                    "id": "sc901206881156_8OJW5VI9",
                    "color": "#87909e",
                    "type": "open",
                    "orderindex": 0
                },
                "creator": {
                    "id": 164437448,
                    "username": "Ulysse",
                    "color": "",
                    "email": "mail@mail.com",
                    "profilePicture": null
                },
                "assignees": [],
                "orderindex": "39745223.00000000000000000000000000000000",
                "description": "",
                "__IMTINDEX__": 17,
                "__IMTLENGTH__": 20
            },
            {
                "id": "86977",
                "url": "https://app.clickup.com/t/86977",
                "name": "VFX",
                "status": {
                    "status": "staffing",
                    "id": "sc901206881156_8OJW5VI9",
                    "color": "#87909e",
                    "type": "open",
                    "orderindex": 0
                },
                "creator": {
                    "id": 164437448,
                    "username": "Ulysse",
                    "color": "",
                    "email": "mail@mail.com",
                    "profilePicture": null
                },
                "assignees": [],
                "orderindex": "39745222.00000000000000000000000000000000",
                "description": "",
                "__IMTINDEX__": 18,
                "__IMTLENGTH__": 20
            },
            {
                "id": "86977",
                "url": "https://app.clickup.com/t/86977",
                "name": "Etalonnage",
                "status": {
                    "status": "staffing",
                    "id": "sc901206881156_8OJW5VI9",
                    "color": "#87909e",
                    "type": "open",
                    "orderindex": 0
                },
                "creator": {
                    "id": 164437448,
                    "username": "Ulysse",
                    "color": "",
                    "email": "mail@mail.com",
                    "profilePicture": null
                },
                "assignees": [],
                "orderindex": "39745221.00000000000000000000000000000000",
                "description": "",
                "__IMTINDEX__": 19,
                "__IMTLENGTH__": 20
            },
            {
                "id": "86977",
                "url": "https://app.clickup.com/t/86977",
                "name": "Montage",
                "status": {
                    "status": "staffing",
                    "id": "sc901206881156_8OJW5VI9",
                    "color": "#87909e",
                    "type": "open",
                    "orderindex": 0
                },
                "creator": {
                    "id": 164437448,
                    "username": "Ulysse",
                    "color": "",
                    "email": "mail@mail.com",
                    "profilePicture": null
                },
                "assignees": [],
                "orderindex": "39745220.00000000000000000000000000000000",
                "description": "",
                "__IMTINDEX__": 20,
                "__IMTLENGTH__": 20
            }
        ],
        "__IMTAGGLENGTH__": 8
    }
]