Hi. We have a date of birth and age field in Pipedrive. We want to auto-compute the age based on the date of birth. I came across an article the might be solution using Formatter. Can someone share step by step guide? Ty
Hi
Good question.
Try this Zap action: Code - JavaScript
// Convert the birthdate string to a Date object
let birthdate = new Date(inputData.birthdate);
// Get the current date
const currentDate = new Date();
// Calculate the age
const age = currentDate.getFullYear() - birthdate.getFullYear() - (currentDate.getMonth() < birthdate.getMonth() || (currentDate.getMonth() === birthdate.getMonth() && currentDate.getDate() < birthdate.getDate()) ? 1 : 0);
output = {age, birthdate}];
Hi
Hi.
See below:
You need to add a Step 3 to update the Person from Step 1.
Hi
The ID needs to be mapped from Step 1.
The screenshots shows the mapped dynamic variable is not a valid variable.
Hi
Hi there
I’m jumping in to see if I can help!
You will need the Person ID from the trigger, and map that as a custom value to the “Person” field in the Update Person step. Here’s what the Person ID data looks like:
Additionally, it looks like you’re using an identical trigger (Updated Person) and action (Update Person) this might cause your Zap to loop infinitely. I suggest changing the trigger to the New Person trigger.
Hopefully, this helps!
Search for ID.
Thank you so much
Awesome! Glad to hear Troy was able to help you out
If you have any other questions, please don’t hesitate to reach out to the Community. We’re always happy to help!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.