Cuidado con el uso de DataField, mejora urgente!

Hola, por recomendacion de ustedes, pidieron que para eliminar o modificar un elemento de una lista de DataField, hay que seguir el siguiente procedimiento:
1-Traer todos los ID con sus nombres correspondientes de la table del datafield que se necesita
2-luego eliminar o modificar el elemento que no quiere de lo que uno trajo
3-“ELIMINAR COMPLETAMENTE” dicha tabla del dafafield
4-Subir nuevamente la tabla modificada.

Estuvimos evaluando y esto es un peligro, ya que si la api se corta en el camino o hay un problema con la subida, se pierden elementos y los deals las relaciones.

Creo que es importante tener una mejora donde mediante API uno pueda eliminar o modificar un elemento sin llegar a correr estos riesgos como en cualquier otro sistema.
Se podra obtener esto en poco tiempo?
Desde ya muchas gracias.
Paul

Hola @cyberpolito
Could you clarify what you mean by DataField? Any reference to Developer Docs / Screenshots / Logs would be helpful as well :slight_smile:

Feel free to link to earlier topic / support thread for context.

1 Like

https://developers.pipedrive.com/docs/api/v1/DealFields

Los contenidos de cada DATA FIELD, no se pueden manipular por API
Si por ejemplo tengo creado un DATA FIELD llamado CITY si tengo que modificar o eliminar un solo valor dentro de CITY, ustedes recomiendan copiar primero todo el contenido con todas las ciudades con su ID correspondiente, eliminar el contenido del data field y luego subir nuevamente todo sin el dato que se acaba de eliminar.
Si en el medio hay un problema de comunicacion se pierde todo el contenido. Creo que no es una forma practica de hacerlo. Tendria que haber una llamada de API para estas cosas a esta altura como en cualquier otro sistema.
Desde ya muchas gracias.

Hola alguien que pueda ayudarme o dar una respuesta por favor? muchas gracias.

Hello @cyberpolito :slight_smile:

We have a tutorial for updating a custom field’s value using our API without copying/deleting the field’s contents.

Let us know if you have further questions!

Thank you for your answer but that doesn’t solve what I’m asking.
What is urgently needed is an api to be able to add values ​​to a data field created.
The data field is already created, and if you need to add a value to said datafield, you can’t do it via API.
If you know or somebody how to do it, please tell me.
Thanks in advance.

Hello!

The tutorial mentioned above about updating a custom field’s value using our API covers this topic.

I’ll briefly cover the steps of the tutorial:

  1. I have a custom data field (city) for Deals and I would like to change its value from “Paris” to “London” for some deal
  2. I call the GET /dealFields endpoint and find the key (UUID value) for that city custom field, for example:
...
"id": 12488,
"key": "08f5098afcc07f28b6bbd9ab185d31ac11d5f350",
"name": "City test field",
...
  1. I call the PUT /deals/{id} endpoint and pass my key value as a body parameter (in my example, "08f5098afcc07f28b6bbd9ab185d31ac11d5f350") and new value “London” as the parameter’s value. Now the city has been updated from Paris to London for this deal.

Please let me know if you have additional questions. :slight_smile:

1 Like

Lo que estoy consultando no tiene que ver con los deals,
Sino con con los campos de datos personalizados.
Si tengo un DATAFIELD llamado CITY
con londres, paris, etc
y quiero agregar Qatar por API, como se debe hacer?

Hi @cyberpolito!

Deals is one example. The same logic for updating custom data fields’ value goes for persons, organizations and leads.

Could you share the data type of your city data field - is it text, multiple options, or something else?
By “adding Qatar by API”, do you wish to update this city value to Qatar for some lead/deal/person/organization? Or do you wish to add Qatar as a possible multiple option value for that city field?

The name of this datafield is City and this field are “option”, with options (paris, londres,etc)
I need add a value more to this field “City”, ej: “Qatar” or “NY”

Hi @cyberpolito

Got it! Depending on whether this datafield is a custom lead/deal, person, organization or product field, you can use the following PUT endpoints to update the options:

In those, you can use the options body parameter to change the values.