I’m having trouble with a Pipedrive ‘Create a Lead’ module. When I hard-code a multiselect field, it works fine and creates the correct numeric array format in the input bundle:
But when I use mapping, the same field gets converted to a string format that causes errors:
How can I ensure the mapped values maintain the correct numeric array format that Pipedrive expects?
1 Like
OK, that took me WAY too long.
I finally found something that worked here. I added a JSON module before the Pipedrive ‘Create a Lead’ module that splits the string based on the comma, then makes a numeric array to pass to the map field.
{“number_array”:[
{{ join(split(“28,29”; “,”); “,”) }}
]}
You can get all the IDs coma separated and then use spit function to process them correctly
Split({{IDs_coma_seperated}};,)
Best regards,
Msquare Automation
Platinum Partner of Make
@Msquare_Automation
1 Like
Hi @Bryce_Kuklok
Here is the example.
Best regards,
Msquare Automation
Platinum Partner of Make
@Msquare_Automation
Thanks! I tried that, but it didn’t work because the data was still being interpreted as a string when the API required a number. That’s why I had to go through the little extra rigmarole of creating a number array with JSON.
1 Like
Welcome to the Make community!
To do this, you can use the built-in function add
— “Adds values specified in parameters to an array and returns that array.”
{{ add (array; value1; value2; ...) }}
e.g.:
{{ add(emptyarray; 28; 29) }}
(copy-paste the above into the field, or type it exactly as shown)
For more information, the function’s documentation can be found in the Help Centre. You should also complete the tutorials in the Make Academy.
Hope this helps! Let me know if there are any further questions or issues. P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!
— @samliew