Set the custom field (multiple options) value while adding the deal

Hi everyone,

I have been developing web app to call PipeDrive API to create deals from form data. I created a custom field “Number of Days” is multiple options (Monday, Tuesday, … Friday). And I call api to get id
“key”: “d2eed536e7116cfb50b3fa49dbb164fcfc3e4d67”,

“options”: [
“label”: “Monday”,
“id”: 24
“label”: “Tuesday”,
“id”: 25
“label”: “Wednesday”,
“id”: 26
“label”: “Thursday”,
“id”: 27
“label”: “Friday”,
“id”: 28

Now I want to set the custom field value while adding the deal. If set key_value[“d2eed536e7116cfb50b3fa49dbb164fcfc3e4d67”] = 24. The custom field is updated “Monday” is correct. However, let say I want to set the custom filed to Monday and Tuesday it will not set. I have tried the following options to pass parameters like below

key_value[“d2eed536e7116cfb50b3fa49dbb164fcfc3e4d67”] = ‘[24,25]’
key_value[“d2eed536e7116cfb50b3fa49dbb164fcfc3e4d67”] = ‘[{“id”:24, label:“Monday”}, {“id”:25, label:“Tuesday”}]’

Please advise,
Thank you

Hey @Trung_Huynh
Welcome to the community :slight_smile: I see that you are already on the right track

  • Are you calling the API via HTTP libraries or via SDK?
  • Can you share the code snippet if possible?

I believe the format you want is:

key_value[“d2eed536e7116cfb50b3fa49dbb164fcfc3e4d67”] = ‘24,25’

When in doubt, make the update to a Pipedrive deal in the website interface, then check the details from PD API call to see what format it’s stored in there.