How to update custom field value

Hi,

I want to update a custom field value but i couldn’t find a way to do that in the api documentation. How can i achieve this?

Thank you.

Hey Peter,

Custom fields are listed directly in the API Reference, but you can use the reference to find the Field’s values and then update them this way.
I would check out this post here for more information: Updating customized fields of organisation using the api

Hi David,

Thank you for the reply. Sorry i wasn’t clear the other time. I am trying to update a custom deal field value. Where do i find the api for this as i can’t find any api reference for it?

Thanks.

You would use https://developers.pipedrive.com/docs/api/v1/#!/DealFields/put_dealFields_id to update the custom Field, but you’ll need to get the Field’s ID first (if you don’t already have it) from https://developers.pipedrive.com/docs/api/v1/#!/DealFields/get_dealFields

Hi David,

Thanks for the reply. I see in the request api that there is an options parameter in this request (https://developers.pipedrive.com/docs/api/v1/#!/DealFields/put_dealFields_id). How does not set the value in the options. Do i pass a value key to it?

Thank you.

For the Options JSON string?
I’ll post what it says in Reference:
When field_type is either set or enum, possible options must be supplied as a JSON-encoded sequential array of objects. All active items must be supplied and already existing items must have their ID supplied. New items only require a label. Example: [{“id”:123,“label”:“Existing Item”},{“label”:“New Item”}]

@David How can i add custom field as set in Deal ?. Like i have custom field called department and their values are [“Fintech”, “Educational”]. I need to add while adding the deal

hi @jabbar_memon. You can set the custom field value while adding the deal, like any other parameters.
You just need to find the key of the custom field.

If you do a GET /dealFields, your custom field will look something like this:

{
    "id": 12489,
    "key": "4f4b539fb83ce51d81c7308246eb99bcbc1b4538",
    "name": "My Custom Field",
    "field_type": "set",
    [...]
    "options": [{
            "label": "Fintech",
            "id": 21
        },
        {
            "label": "Educational",
            "id": 22
        }
    ]
}

So you can get the key (4f4b539fb83ce51d81c7308246eb99bcbc1b4538) and pass it while adding the deal. As value, you can use the id of the option.

For example, to add a new deal with the custom field set to “Fintech”:

POST /deals

title: "New Deal"
4f4b539fb83ce51d81c7308246eb99bcbc1b4538: 21
3 Likes