Issue with Processing Multiple-choice responses from Typeform to Pipedrive

Hello,

I have an issue with my Make flow between Typeform and Pipedrive. I want to use the responses from a multiple-choice question to send data to Pipedrive in “number” format instead of text. I am facing two problems:

  1. When I use the Switch module, I only get one output value, even though I expect three values based on my tests.
  2. When trying to send data to Pipedrive, I am unable to send the data in “number” format.

Here’s a description of my flow with screenshots:

  1. Array Aggregator Module

  2. Iterator Module


  3. Switch Module


  4. Array Aggregator Module


  5. Pipedrive “create a lead” Module:

When I execute this flow, I have this message :
"The operation failed with an error. 400: provided dataset is not valid (“f6c813cbffcd8” must be a number)

I would appreciate any help or suggestions to resolve these issues.

Thank you!

Hello @slobald and welcome to the Make Community!

This is how switch works. You check one value and if one of the switch cases matches it will output that single value, or the “else” case if none of the others match.

I don’t really see any screenshot of your Pipedrive module.
Do you have a screenshot of that?
Basically it looks like you’re probably submitting an array when it’s expecting a number.
In Pipedrive, where it’s expecting a number as input, try using the get() or first() function on the Postes array to get that first element.

Hello @Donald_Mitchell
thank you for your feedback !

So, how can I resolve this issue please? I need to map my responses to the Pipedrive IDs, but I am unable to get the multiple values I want. Do you have any suggestions on the best way to proceed to send all corresponding values in a single operation?

Yes !


Thank you for your help.

Sorry I don’t feel like I have a full enough understanding about what you’re trying to do.
Are you able to post a blueprint and/or add details about the specific issue?

As for the Postes field, if you have Map enabled like in the screenshot, you need to submit an array, but it needs to be an array formatted specifically for that field. To do that, in the Array Aggregator field that comes before Pipedrive, you can select the Pipedrive Postes option in the Data Structure dropdown field.

Hope that makes sense and hope it helps.

If you can get those lookups in the form of array of collections, you can iterate on 102.Array.Mappable Answers.Postes (like you already are), then use the map() function to translate the names to an array of values.

If you expand this Scenario Snippet, you can copy the whole thing and paste into a new scenario to see an example.

Scenario Snippet
{
    "subflows": [
        {
            "flow": [
                {
                    "id": 7,
                    "module": "json:ParseJSON",
                    "version": 1,
                    "parameters": {
                        "type": ""
                    },
                    "mapper": {
                        "json": "{\"Lookups\":[{\"Name\":\"Chauffeur de finisseur\",\"Value\":27},{\"Name\":\"Mini-finisseur\",\"Value\":28},{\"Name\":\"Régleur de finisseur\",\"Value\":29},{\"Name\":\"Cylindreur\",\"Value\":30},{\"Name\":\"Niveleur\",\"Value\":31},{\"Name\":\"Raboteur\",\"Value\":32},{\"Name\":\"Autres\",\"Value\":33}]}"
                    },
                    "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": 5,
                    "module": "builtin:BasicFeeder",
                    "version": 1,
                    "parameters": {},
                    "mapper": {
                        "array": "{{split(\"Chauffeur de finisseur,Mini-finisseur,Régleur de finisseur,Cylindreur,Niveleur,Raboteur,Autres\"; \",\")}}"
                    },
                    "metadata": {
                        "designer": {
                            "x": 300,
                            "y": 0
                        },
                        "restore": {
                            "expect": {
                                "array": {
                                    "mode": "edit"
                                }
                            }
                        },
                        "expect": [
                            {
                                "name": "array",
                                "type": "array",
                                "label": "Array",
                                "mode": "edit",
                                "spec": []
                            }
                        ]
                    }
                },
                {
                    "id": 10,
                    "module": "util:TextAggregator",
                    "version": 1,
                    "parameters": {
                        "rowSeparator": "other",
                        "otherRowSeparator": ",",
                        "feeder": 5
                    },
                    "mapper": {
                        "value": "{{first(map(7.Lookups; \"Value\"; \"Name\"; 5.value))}}"
                    },
                    "metadata": {
                        "designer": {
                            "x": 600,
                            "y": 0,
                            "messages": [
                                {
                                    "category": "last",
                                    "severity": "warning",
                                    "message": "A transformer should not be the last module in the route."
                                }
                            ]
                        },
                        "restore": {
                            "parameters": {
                                "rowSeparator": {
                                    "label": "Other"
                                }
                            },
                            "extra": {
                                "feeder": {
                                    "label": "Iterator [5]"
                                }
                            }
                        },
                        "parameters": [
                            {
                                "name": "rowSeparator",
                                "type": "select",
                                "label": "Row separator",
                                "validate": {
                                    "enum": [
                                        "\n",
                                        "\t",
                                        "other"
                                    ]
                                }
                            },
                            {
                                "name": "otherRowSeparator",
                                "type": "text",
                                "label": "Separator"
                            }
                        ],
                        "expect": [
                            {
                                "name": "value",
                                "type": "text",
                                "label": "Text"
                            }
                        ],
                        "advanced": true
                    }
                }
            ]
        }
    ],
    "metadata": {
        "version": 1
    }
}

Hope this helps! There are other ways to do it too so this is just describing one.

Hello Donald,

Thank you for your feedback.

I added your flow to my scenario and it works well, except that I still get the error ‘400: provided dataset is not valid (“f6c813cbffcd882dbb07cf78e098f72e96dd1430[0]” must be a number)’ when sending the request to Pipedrive.

I added a filter between the iterator module and text aggregator to only filter the form responses and keep only those for sending to Pipedrive.

I tried using the ‘set variable’ module to convert the result from the ‘text aggregator’ result module to a number, but it didn’t work

{
    "subflows": [
        {
            "flow": [
                {
                    "id": 109,
                    "module": "util:SetVariable2",
                    "version": 1,
                    "parameters": {},
                    "mapper": {
                        "name": "numeric_value",
                        "scope": "roundtrip",
                        "value": "{{parseNumber(106.text)}}"
                    },
                    "metadata": {
                        "designer": {
                            "x": 1811,
                            "y": 368
                        },
                        "restore": {
                            "expect": {
                                "scope": {
                                    "label": "One cycle"
                                }
                            }
                        },
                        "expect": [
                            {
                                "name": "name",
                                "type": "text",
                                "label": "Variable name",
                                "required": true
                            },
                            {
                                "name": "scope",
                                "type": "select",
                                "label": "Variable lifetime",
                                "required": true,
                                "validate": {
                                    "enum": [
                                        "roundtrip",
                                        "execution"
                                    ]
                                }
                            },
                            {
                                "name": "value",
                                "type": "any",
                                "label": "Variable value"
                            }
                        ],
                        "interface": [
                            {
                                "name": "numeric_value",
                                "label": "numeric_value",
                                "type": "any"
                            }
                        ]
                    }
                }
            ]
        }
    ],
    "metadata": {
        "version": 1
    }
}

thank you for your help.

In Pipedrive, how many values are you trying to use for the Postes field?

Is it a single number or an array of numbers?

If it’s an array of numbers you can try using split(text;,) on the text output from the Text Aggregator and that will give you an array of [28,29,30] and that might be what your Pipedrive module needs in the Postes field.
To be clear, the Pipedrive fields needs an array, not text, so in that field is where you would use the split() function because the result of a split() is an array.

If that doesn’t work, we need to know the expected structure of that field.
Turn off Map, add an item then get a look at what the fields are asking for and that will give an idea of the structure.

Normally, when Map is enabled, you can select that field as a Data Structure option in an aggregator that comes before the Pipedrive module.
For example, be sure Map is enabled on the Postes field in Pipedrive
After the Text Aggregator, add an Iterator.
In the Iterator’s field you enter in split(text;,) on the text from the Text Aggregator.
Then, add an Array Aggregator.
Make sure the Array Aggregator has a connection to Pipedrive, then in the Data Structure dropdown, you should see an option for the Pipedrive Postes field.

Hope that makes sense and hope it helps!

Hello Donald,

Here is the expected structure by Pipedrive for the fields:

[
    {
        "title": "Mission",
        "value": {},
        "person_id": 22,
        "organization_id": 24,
        "f6c813cbffcd882dbb07cf78e098f72e96dd1430": [
            28,
            29,
            30
        ]
    }
]

VS the structure we are currently sending with our flow:

[
    {
        "title": "Mission",
        "value": {},
        "person_id": 22,
        "organization_id": 24,
        "f6c813cbffcd882dbb07cf78e098f72e96dd1430": [
            "28",
            "29",
            "30"
        ]
    }
]

The issue is that we are sending the values as text (“28”, “29”, “30”) with quotes, whereas Pipedrive expects a structure without quotes.