Label Numbers vs labels

When using the built in “Label” field, Pipedrive assigns a numeric value to each label the user assigns in this field, just the same as a multi-select custom field that one could setup. The difference is that in the webhook, a custom field will contain both the numeric value and the label. However, for the “Label” field itself, only the numeric value is transmitted through the webhook - at least as far as I can tell - I only use Integromat. I would like to request that the “label” for the Label also be sent in the webhook. Right now my work around is that I use a custom field instead of Labels, but would prefer to use the built in Labels.

Hi @hvy_weight

Indeed, Webhook’s request body for a Deal includes only label’s id, something like this

"label": 9

To get its name (or label’s label), you need to make GET /dealFields request and find a field with

"key": "label"

It will have “options” key, and in my case it looks like this

 "options": [
         "color": "blue",
         "label": "test",
         "id": 9

so, once Webhook is called with label:9 that means that a Deal has label: test.

More about Labels here

@mykhailo thank you for the info! Do you happen to know if it’s on the roadmap to include the label “label” in the webhook itself? I access that field frequently in my automations, and it would be a lot of work to put in an extra “GET” for every time we need to access that field.

1 Like

@hvy_weight as far as I know, there are no plans to add label’s label to the Deal payload at the moment.

1 Like

After doing a GET /dealFields request, how would I write the code to input the key and the id and have the output return the label ‘test’ as in the above example? or at least just input the id and return the label? I just want getdetails to return the labels not the ids it seems the way to go about getting the labels given the deal key you have to go through multiple steps of looping arrays. Is there an easy example to walk through how this is done? Also I’m using javascript not php.

@mykhailo +1 for adding the label’s label to the API. Otherwise it requires looping all label options for every call.