Asana multi-select custom field assistance

I’m looking to automate data from Airtable to Asana. In both Airtable and Asana there is a multi-select field(“Name”), each with the same 4 options (“Option A”, “Option B”, “Option C”, and “Option D”). If “Name” only has one option selected (ex. just “Option C” is present in the field in Airtable), it runs without issue, but I get an error if there are multiple fields (ex. “Option A” & “Option D” are present in the field in Airtable).

This is my scenario:

The Iterator pulls in the “Name” Array and separates them

[
    {
        "value": "Option A",
        "__IMTINDEX__": 1,
        "__IMTLENGTH__": 4
    },
    {
        "value": "Option B",
        "__IMTINDEX__": 2,
        "__IMTLENGTH__": 4
    },
    {
        "value": "Option C",
        "__IMTINDEX__": 3,
        "__IMTLENGTH__": 4
    },
    {
        "value": "Option D",
        "__IMTINDEX__": 4,
        "__IMTLENGTH__": 4
    }
]

The Switch tool swaps the text from the array with the corresponding Asana ID number, as I found that even with just one option selected, Asana did not accept text to text, and needed the ID:

The text aggregator brings them back together:

NOTE: While it currently says “Row Separator: Other”, "Separator: , ", I have tried this with every iteration in the “row separator” dropdown, as well as added the “toArray()” function around the text output to no avail.

In the output of both Asana Routes, the text aggregator is mapped to the “Name” field:

3

NOTE: I have also tried to add the “toArray()” function around the text output here as well, but in this instance, it returns an error regardless of how many options are selected on the Airtable side.

This is what a successful output looks like when a record only has one option selected:

        "custom_fields": [
            {
                "gid": "120...",
                "resource_type": "custom_field",
                "resource_subtype": "multi_enum",
                "type": "multi_enum",
                "name": "NAME",
                "enabled": true,
                "enum_options": [
                    {
                        "gid": "1205691905a",
                        "resource_type": "enum_option",
                        "enabled": true,
                        "name": "Option A",
                        "color": "blue"
                    },
                    {
                        "gid": "1205691905b",
                        "resource_type": "enum_option",
                        "enabled": true,
                        "name": "Option B",
                        "color": "blue-green"
                    },
                    {
                        "gid": "1205691905c",
                        "resource_type": "enum_option",
                        "enabled": true,
                        "name": "Option C",
                        "color": "yellow-green"
                    },
                    {
                        "gid": "1205691905d",
                        "resource_type": "enum_option",
                        "enabled": true,
                        "name": "Option D",
                        "color": "aqua"
                    }
                ],
                "multi_enum_values": [
                    {
                        "gid": "1205691905d",
                        "resource_type": "enum_option",
                        "enabled": true,
                        "name": "Option D",
                        "color": "aqua"
                    }
                ],
                "display_value": "Option D",
                }
            }

And here are the error messages I’ve been receiving:
4

5

Can someone help me? I think my issue is that the text aggregator isn’t combining back into an array, but I’ve run out of ideas on how to do that.

I apologize for censoring some parts of this and not sharing the blueprint .json, but I am not comfortable sharing everything as it shows data I am not comfortable sharing pulled from both Airtable and Asana. Know that the text to ID swap works exactly as intended, as it will run properly with all 4 options so long as it is the only one selected, and so is not part of the issue.

Hi @b86

I observed that multi_enum_values is a collection array. Directly mapping the text or using the toArray function may not yield the desired structure. To address this, consider using an array aggregator before Asana and map the necessary elements there, specifying the target structure type as Asana to resolve the issue.

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

2 Likes

Thank you for this! I am admittedly not used to using these functions in Make. I’ve watched multiple videos on it in an attempt to figure them out better, I still am unsure about exactly how they work.

I’ve switched to an array aggregator, and despite the array looking as though it aggregates correctly, it’s only choosing the first item in the array and not everything.

My new scenario looks like this:

NOTE: I did try the following scenario first, but despite putting it right before Asana it did not offer any target structure other than “custom”, so I swapped to the one above as it didn’t seem to make a difference.


Going back to my current scenario, this is how the array aggregator is set up:

This is what it returned on an Airtable record with all 4 options selected:

[
    {
        "array": [
            {
                "output": "1205691905a"
            },
            {
                "output": "1205691905b"
            },
            {
                "output": "1205691905c"
            },
            {
                "output": "1205691905d"
            }
        ],
        "__IMTAGGLENGTH__": 4
    }
]

This is how it’s reading the aggregator:
11

And this is what it added in Asana:
10a

        "custom_fields_collection": {
            "120...": {
                "gid": "120...",
                "resource_type": "custom_field",
                "resource_subtype": "multi_enum",
                "type": "multi_enum",
                "name": "NAME",
                "enabled": true,
                "multi_enum_values": [
                    {
                        "gid": "1205691905a",
                        "resource_type": "enum_option",
                        "enabled": true,
                        "name": "Option A",
                        "color": "blue"
                    }
                ],
                "display_value": "Option A",
                "enum_options": [
                    {
                        "gid": "1205691905a",
                        "resource_type": "enum_option",
                        "enabled": true,
                        "name": "Option A",
                        "color": "blue"
                    },
                    {
                        "gid": "1205691905b",
                        "resource_type": "enum_option",
                        "enabled": true,
                        "name": "Option B",
                        "color": "blue-green"
                    },
                    {
                        "gid": "1205691905c",
                        "resource_type": "enum_option",
                        "enabled": true,
                        "name": "Option C",
                        "color": "yellow-green"
                    },
                    {
                        "gid": "1205691905d",
                        "resource_type": "enum_option",
                        "enabled": true,
                        "name": "Option D",
                        "color": "aqua"
                    }
                ]

I also tried this:
12

But it returned an error message:
13

The operation failed with an error. [400] multi_enum_values: [0]: Not a valid GID type: object

I know I’m missing something to make this work, but I’m not sure what.

1 Like