Closed tw1t611 closed 3 years ago
Hi @tw1t611
I'm using version pipedrive@10.6.1
and can be updated like so:
const lib = require('pipedrive');
lib.Configuration.apiToken = 'API_TOKEN';
const dealFieldId = '69b9b46432b6d23950fd2a696e5017f85b0972ab';
async function runExample() {
let deal, updatedDeal;
try {
deal = await lib.DealsController.getDetailsOfADeal(262160);
updatedDeal = await lib.DealsController.updateADeal({
id: deal.data.id,
[dealFieldId]: 'some nice custom field value 3',
});
} catch (error) {
console.log(error)
}
console.log(updatedDeal);
}
runExample();
It results in:
Some notes: 1) wrap your code in a try-catch to see error messages. 2) make sure your using the correct custom field hash, which can be copied here just to be safe -> https://app.pipedrive.com/settings/fields
It somehow works now. Thanks for your help. Also thank you for the link. Closing now. :)
I need to update a custom field in a Deal.
I tried:
The response does not show any hashes of custom fields. It works, when I omit
[dealFieldId]: deal.data.id
. Is this possible in another way in v10? I know, that zapier got it working somehow.