Auto-Age Computation in Pipedrive

Hi. We have a current automation running in MAKE to compute age from date of birth. It’s been working well. But how can we make it happen to compute with two decimals and not auto-round it off. It’s important for us to know the exact age. Seeking advice. Thank you!

Here’s the formula at the moment:
Please let us know if you need any other details.

Hi @aamag ,

There is an interesting computation here.
I built this function:
image
and I tested it with this scenario (please find in attachment the corresponding blueprint
age_computation.json (5.0 KB)).
Just one point, take care of the data format.

I hope it helps.

PBI

3 Likes

Hi @Philippe_Billet Thank you for your response. Does this mean we have to remove Module 2 - Update a person and replace it with a set variable tool? or where should we place that? Thank you


1 Like

No, I used some variables for computation purpose, the most important here is the formula. Technically speaking, you just have to use it to feed your age variable in the module you want to call, and be careful with date format.

2 Likes

Hi @Philippe_Billet Got it. I’ll copy the formula. Though, for the date format, would it matter if we are in the AUS date format, dd-mm-yyyy. The formula is still good to copy, right?

image

Hi @Philippe_Billet I tried it and hit an error. Could you please check what I did below?


Hi @aamag ,

The function looks good, so can you display the date value at the output of the pipedrive module?

2 Likes

Hi @Philippe_Billet It doesn’t push through the next module at all and I was getting that error previously posted…

Hi @aamag,

Could you display the output bundle of the preceding module (at least the date), according to the error message the value of this data looks inappropriate.
Without that, it will not be possible to help you, it is like finding a needle in a haystack.

BR,

PBI

2 Likes
[
    {
        "event": "updated.person",
        "current": {
            "related_closed_deals_count": 0,
            "email_messages_count": 0,
            "cc_email": "visaways@pipedrivemail.com",
            "owner_id": 15425454,
            "postal_address_subpremise": null,
            "participant_open_deals_count": 0,
            "9f04257c68819c125e49767be130a4e40737f149": null,
            "fff5184cd1a46ebada32cfdfa0f956b63aa1cd51": null,
            "postal_address_locality": null,
            "id": 7498,
            "im": [
                {
                    "value": "",
                    "primary": true
                }
            ],
            "label_ids": [],
            "undone_activities_count": 0,
            "9581de19cd2a9adb977862bb26cdfb4de2e5e0db": null,
            "next_activity_id": null,
            "50c21f3274337b70e32f5e498d64870787f8c284": null,
            "phone": [
                {
                    "label": "work",
                    "value": "11111110111",
                    "primary": true
                }
            ],
            "notes_count": 0,
            "participant_closed_deals_count": 0,
            "6444ca40d14686194d85be94377323bb9feff552_route": null,
            "postal_address_postal_code": null,
            "5c4061507ba91c95661f784880f5b45d0c10510d": null,
            "active_flag": true,
            "picture_id": null,
            "6444ca40d14686194d85be94377323bb9feff552_street_number": null,
            "update_time": "2024-03-06T11:16:02.000Z",
            "15448303db21b29b08e7c3100463749e2c8b1515": null,
            "30dd2e770e5429724da28f93cb1ee6ddb15d2c05": null,
            "activities_count": 1,
            "4ea5cb81f9101b990963f0f594539ad90907eecc": null,
            "778000122e9bdd8fe28cd4c71f49844dc555f32b": "1982-02-15T14:00:00.000Z",
            "6444ca40d14686194d85be94377323bb9feff552_country": null,
            "postal_address_route": null,
            "org_name": null,
            "b0fdd5f6f3c1da9b30172c0db63494d42940bcd1": null,
            "email": [
                {
                    "label": "work",
                    "value": "crm@magneticalliance.com.au",
                    "primary": true
                }
            ],
            "files_count": 0,
            "company_id": 10690320,
            "last_incoming_mail_time": null,
            "6444ca40d14686194d85be94377323bb9feff552_subpremise": null,
            "6444ca40d14686194d85be94377323bb9feff552_admin_area_level_1": null,
            "6444ca40d14686194d85be94377323bb9feff552_admin_area_level_2": null,
            "6444ca40d14686194d85be94377323bb9feff552_postal_code": null,
            "last_name": "Test",
            "related_lost_deals_count": 0,
            "postal_address_formatted_address": null,
            "postal_address_sublocality": null,
            "1e94dc68f91d3ca967a49d0f86510a66d24506dd": null,
            "a4d39376f5b26192f985c06ed92cf1c2b7465fea": null,
            "30a4ffb15e119928acdee03c7dbb4e769cae422b": null,
            "6822c9d679b6d5619bb460bdfe02df70c5f14d54": 10,
            "6444ca40d14686194d85be94377323bb9feff552_formatted_address": null,
            "6444ca40d14686194d85be94377323bb9feff552_sublocality": null,
            "done_activities_count": 1,
            "5d6d1cdbec8ba2643988f7fe616fb7703cc7130c": null,
            "notes": null,
            "open_deals_count": 1,
            "next_activity_date": null,
            "job_title": null,
            "6444ca40d14686194d85be94377323bb9feff552": null,
            "5ddb843a156419bc34682a8d7e0c7d1f5af165d4": null,
            "postal_address": null,
            "2a794cd901182dd96dfcb6265d5640de07534d9f": null,
            "owner_name": "Cristian Aguirre",
            "related_won_deals_count": 0,
            "375c771c3c6bd102d0815964946142d5d95da2ce": null,
            "00c9b2ae74bf23cc6bce73c95066e3ee952b7314": null,
            "picture_128_url": null,
            "2a54cb84b45738ef596b332be6a8ca19522c6b49": null,
            "last_activity_date": "2024-02-15T14:00:00.000Z",
            "last_activity_date-raw": "2024-02-16",
            "postal_address_country": null,
            "15dd9251c2a7397e7e26e0cb3acb3b504d24ee62": null,
            "ec3c4dd5745d8017d60aea749234dc39f704c912": null,
            "visible_to": "3",
            "org_id": null,
            "name": "Mag Test",
            "lost_deals_count": 0,
            "next_activity_time": null,
            "594923713cb6b34301bf9480751d119fbde14fd5": null,
            "birthday": null,
            "delete_time": null,
            "d186a5a4fdce979680f5b8f2c85f9a59c0861d1a": null,
            "last_outgoing_mail_time": null,
            "13cd072a4b7767a4c18b7140b568658ffbd176e9": null,
            "last_activity_id": 3148,
            "b2b90e9fb42e1331a5cc5e3c8f31e42714d0bc1b": null,
            "first_name": "Mag",
            "postal_address_street_number": null,
            "won_deals_count": 0,
            "bc72cfe417cfa33e12d0d0ed102426b3dffce845": null,
            "f4ea138324ac8dd0cf8f21968ef874efe98bd1a9": null,
            "first_char": "m",
            "closed_deals_count": 0,
            "label": null,
            "related_open_deals_count": 0,
            "postal_address_admin_area_level_2": null,
            "postal_address_admin_area_level_1": null,
            "followers_count": 1,
            "6444ca40d14686194d85be94377323bb9feff552_locality": null,
            "add_time": "2024-02-16T09:57:33.000Z",
            "4cf343bc77af8bf39b9aeca4b92c849def4de06a": {
                "id": "1133",
                "label": "(Subclass 176) - Skilled Sponsored Visa"
            },
            "customRaw": {
                "9f04257c68819c125e49767be130a4e40737f149": null,
                "fff5184cd1a46ebada32cfdfa0f956b63aa1cd51": null,
                "9581de19cd2a9adb977862bb26cdfb4de2e5e0db": null,
                "50c21f3274337b70e32f5e498d64870787f8c284": null,
                "6444ca40d14686194d85be94377323bb9feff552_route": null,
                "5c4061507ba91c95661f784880f5b45d0c10510d": null,
                "6444ca40d14686194d85be94377323bb9feff552_street_number": null,
                "15448303db21b29b08e7c3100463749e2c8b1515": null,
                "30dd2e770e5429724da28f93cb1ee6ddb15d2c05": null,
                "4ea5cb81f9101b990963f0f594539ad90907eecc": null,
                "778000122e9bdd8fe28cd4c71f49844dc555f32b": "1982-02-16",
                "6444ca40d14686194d85be94377323bb9feff552_country": null,
                "b0fdd5f6f3c1da9b30172c0db63494d42940bcd1": null,
                "6444ca40d14686194d85be94377323bb9feff552_subpremise": null,
                "6444ca40d14686194d85be94377323bb9feff552_admin_area_level_1": null,
                "6444ca40d14686194d85be94377323bb9feff552_admin_area_level_2": null,
                "6444ca40d14686194d85be94377323bb9feff552_postal_code": null,
                "1e94dc68f91d3ca967a49d0f86510a66d24506dd": null,
                "a4d39376f5b26192f985c06ed92cf1c2b7465fea": null,
                "30a4ffb15e119928acdee03c7dbb4e769cae422b": null,
                "6822c9d679b6d5619bb460bdfe02df70c5f14d54": 10,
                "6444ca40d14686194d85be94377323bb9feff552_formatted_address": null,
                "6444ca40d14686194d85be94377323bb9feff552_sublocality": null,
                "5d6d1cdbec8ba2643988f7fe616fb7703cc7130c": null,
                "6444ca40d14686194d85be94377323bb9feff552": null,
                "5ddb843a156419bc34682a8d7e0c7d1f5af165d4": null,
                "2a794cd901182dd96dfcb6265d5640de07534d9f": null,
                "375c771c3c6bd102d0815964946142d5d95da2ce": null,
                "00c9b2ae74bf23cc6bce73c95066e3ee952b7314": null,
                "2a54cb84b45738ef596b332be6a8ca19522c6b49": null,
                "15dd9251c2a7397e7e26e0cb3acb3b504d24ee62": null,
                "ec3c4dd5745d8017d60aea749234dc39f704c912": null,
                "594923713cb6b34301bf9480751d119fbde14fd5": null,
                "d186a5a4fdce979680f5b8f2c85f9a59c0861d1a": null,
                "13cd072a4b7767a4c18b7140b568658ffbd176e9": null,
                "b2b90e9fb42e1331a5cc5e3c8f31e42714d0bc1b": null,
                "bc72cfe417cfa33e12d0d0ed102426b3dffce845": null,
                "f4ea138324ac8dd0cf8f21968ef874efe98bd1a9": null,
                "6444ca40d14686194d85be94377323bb9feff552_locality": null,
                "4cf343bc77af8bf39b9aeca4b92c849def4de06a": "1133"
            }
        },
        "previous": {
            "related_closed_deals_count": 0,
            "email_messages_count": 0,
            "cc_email": "visaways@pipedrivemail.com",
            "owner_id": 15425454,
            "postal_address_subpremise": null,
            "participant_open_deals_count": 0,
            "9f04257c68819c125e49767be130a4e40737f149": null,
            "fff5184cd1a46ebada32cfdfa0f956b63aa1cd51": null,
            "postal_address_locality": null,
            "id": 7498,
            "im": [
                {
                    "value": "",
                    "primary": true
                }
            ],
            "label_ids": [],
            "undone_activities_count": 0,
            "9581de19cd2a9adb977862bb26cdfb4de2e5e0db": null,
            "next_activity_id": null,
            "50c21f3274337b70e32f5e498d64870787f8c284": null,
            "phone": [
                {
                    "label": "work",
                    "value": "11111110111",
                    "primary": true
                }
            ],
            "notes_count": 0,
            "participant_closed_deals_count": 0,
            "6444ca40d14686194d85be94377323bb9feff552_route": null,
            "postal_address_postal_code": null,
            "5c4061507ba91c95661f784880f5b45d0c10510d": null,
            "active_flag": true,
            "picture_id": null,
            "6444ca40d14686194d85be94377323bb9feff552_street_number": null,
            "update_time": "2024-02-29T12:29:20.000Z",
            "15448303db21b29b08e7c3100463749e2c8b1515": null,
            "30dd2e770e5429724da28f93cb1ee6ddb15d2c05": null,
            "activities_count": 1,
            "4ea5cb81f9101b990963f0f594539ad90907eecc": null,
            "778000122e9bdd8fe28cd4c71f49844dc555f32b": "1989-02-09T14:00:00.000Z",
            "6444ca40d14686194d85be94377323bb9feff552_country": null,
            "postal_address_route": null,
            "org_name": null,
            "b0fdd5f6f3c1da9b30172c0db63494d42940bcd1": null,
            "email": [
                {
                    "label": "work",
                    "value": "crm@magneticalliance.com.au",
                    "primary": true
                }
            ],
            "files_count": 0,
            "company_id": 10690320,
            "last_incoming_mail_time": null,
            "6444ca40d14686194d85be94377323bb9feff552_subpremise": null,
            "6444ca40d14686194d85be94377323bb9feff552_admin_area_level_1": null,
            "6444ca40d14686194d85be94377323bb9feff552_admin_area_level_2": null,
            "6444ca40d14686194d85be94377323bb9feff552_postal_code": null,
            "last_name": "Test",
            "related_lost_deals_count": 0,
            "postal_address_formatted_address": null,
            "postal_address_sublocality": null,
            "1e94dc68f91d3ca967a49d0f86510a66d24506dd": null,
            "a4d39376f5b26192f985c06ed92cf1c2b7465fea": null,
            "30a4ffb15e119928acdee03c7dbb4e769cae422b": null,
            "6822c9d679b6d5619bb460bdfe02df70c5f14d54": 10,
            "6444ca40d14686194d85be94377323bb9feff552_formatted_address": null,
            "6444ca40d14686194d85be94377323bb9feff552_sublocality": null,
            "done_activities_count": 1,
            "5d6d1cdbec8ba2643988f7fe616fb7703cc7130c": null,
            "notes": null,
            "open_deals_count": 1,
            "next_activity_date": null,
            "job_title": null,
            "6444ca40d14686194d85be94377323bb9feff552": null,
            "5ddb843a156419bc34682a8d7e0c7d1f5af165d4": null,
            "postal_address": null,
            "2a794cd901182dd96dfcb6265d5640de07534d9f": null,
            "owner_name": "Cristian Aguirre",
            "related_won_deals_count": 0,
            "375c771c3c6bd102d0815964946142d5d95da2ce": null,
            "00c9b2ae74bf23cc6bce73c95066e3ee952b7314": null,
            "picture_128_url": null,
            "2a54cb84b45738ef596b332be6a8ca19522c6b49": null,
            "last_activity_date": "2024-02-15T14:00:00.000Z",
            "last_activity_date-raw": "2024-02-16",
            "postal_address_country": null,
            "15dd9251c2a7397e7e26e0cb3acb3b504d24ee62": null,
            "ec3c4dd5745d8017d60aea749234dc39f704c912": null,
            "visible_to": "3",
            "org_id": null,
            "name": "Mag Test",
            "lost_deals_count": 0,
            "next_activity_time": null,
            "594923713cb6b34301bf9480751d119fbde14fd5": null,
            "birthday": null,
            "delete_time": null,
            "d186a5a4fdce979680f5b8f2c85f9a59c0861d1a": null,
            "last_outgoing_mail_time": null,
            "13cd072a4b7767a4c18b7140b568658ffbd176e9": null,
            "last_activity_id": 3148,
            "b2b90e9fb42e1331a5cc5e3c8f31e42714d0bc1b": null,
            "first_name": "Mag",
            "postal_address_street_number": null,
            "won_deals_count": 0,
            "bc72cfe417cfa33e12d0d0ed102426b3dffce845": null,
            "f4ea138324ac8dd0cf8f21968ef874efe98bd1a9": null,
            "first_char": "m",
            "closed_deals_count": 0,
            "label": null,
            "related_open_deals_count": 0,
            "postal_address_admin_area_level_2": null,
            "postal_address_admin_area_level_1": null,
            "followers_count": 1,
            "6444ca40d14686194d85be94377323bb9feff552_locality": null,
            "add_time": "2024-02-16T09:57:33.000Z",
            "4cf343bc77af8bf39b9aeca4b92c849def4de06a": {
                "id": "1133",
                "label": "(Subclass 176) - Skilled Sponsored Visa"
            },
            "customRaw": {
                "9f04257c68819c125e49767be130a4e40737f149": null,
                "fff5184cd1a46ebada32cfdfa0f956b63aa1cd51": null,
                "9581de19cd2a9adb977862bb26cdfb4de2e5e0db": null,
                "50c21f3274337b70e32f5e498d64870787f8c284": null,
                "6444ca40d14686194d85be94377323bb9feff552_route": null,
                "5c4061507ba91c95661f784880f5b45d0c10510d": null,
                "6444ca40d14686194d85be94377323bb9feff552_street_number": null,
                "15448303db21b29b08e7c3100463749e2c8b1515": null,
                "30dd2e770e5429724da28f93cb1ee6ddb15d2c05": null,
                "4ea5cb81f9101b990963f0f594539ad90907eecc": null,
                "778000122e9bdd8fe28cd4c71f49844dc555f32b": "1989-02-10",
                "6444ca40d14686194d85be94377323bb9feff552_country": null,
                "b0fdd5f6f3c1da9b30172c0db63494d42940bcd1": null,
                "6444ca40d14686194d85be94377323bb9feff552_subpremise": null,
                "6444ca40d14686194d85be94377323bb9feff552_admin_area_level_1": null,
                "6444ca40d14686194d85be94377323bb9feff552_admin_area_level_2": null,
                "6444ca40d14686194d85be94377323bb9feff552_postal_code": null,
                "1e94dc68f91d3ca967a49d0f86510a66d24506dd": null,
                "a4d39376f5b26192f985c06ed92cf1c2b7465fea": null,
                "30a4ffb15e119928acdee03c7dbb4e769cae422b": null,
                "6822c9d679b6d5619bb460bdfe02df70c5f14d54": 10,
                "6444ca40d14686194d85be94377323bb9feff552_formatted_address": null,
                "6444ca40d14686194d85be94377323bb9feff552_sublocality": null,
                "5d6d1cdbec8ba2643988f7fe616fb7703cc7130c": null,
                "6444ca40d14686194d85be94377323bb9feff552": null,
                "5ddb843a156419bc34682a8d7e0c7d1f5af165d4": null,
                "2a794cd901182dd96dfcb6265d5640de07534d9f": null,
                "375c771c3c6bd102d0815964946142d5d95da2ce": null,
                "00c9b2ae74bf23cc6bce73c95066e3ee952b7314": null,
                "2a54cb84b45738ef596b332be6a8ca19522c6b49": null,
                "15dd9251c2a7397e7e26e0cb3acb3b504d24ee62": null,
                "ec3c4dd5745d8017d60aea749234dc39f704c912": null,
                "594923713cb6b34301bf9480751d119fbde14fd5": null,
                "d186a5a4fdce979680f5b8f2c85f9a59c0861d1a": null,
                "13cd072a4b7767a4c18b7140b568658ffbd176e9": null,
                "b2b90e9fb42e1331a5cc5e3c8f31e42714d0bc1b": null,
                "bc72cfe417cfa33e12d0d0ed102426b3dffce845": null,
                "f4ea138324ac8dd0cf8f21968ef874efe98bd1a9": null,
                "6444ca40d14686194d85be94377323bb9feff552_locality": null,
                "4cf343bc77af8bf39b9aeca4b92c849def4de06a": "1133"
            }
        }
    }
]

Here are the details from module 1. Please let me know if you need anything else. Thanks!

According to your knowledge of Pipedrive, which data should contain the birth date of the customer? In your bundle example it is not clear at all that the birth date is in, I can read "birthday": null,.

I know that it will not help you, but first you have to find the data (here the birthday), then apply the function I gave you.

2 Likes

Hi @Philippe_Billet The name of the custom field in Pipedrive for Birthday is ‘Date of Birth’ and the computation should go to ‘Age field’ . Does that answer your question?

These field are all under person record in Pipedrive. To add, would it differ if we use AUS date format dd/mm/yyyy. Wondering if that causes the error as well. Thanks

Hi @aamag ,

There is a misunderstanding between us, I cannot find any “Date of Birth” with a valid value in the output bundle you gave:

When you will have a correct birth date, the date format problem will be the next step: currently, you have to get the date.

BR,

PBI

2 Likes

Hi @DavidGurr_Make Hope you’re well! Just wondering if you know how to fix this?

We have a current automation running in MAKE to compute age from date of birth. It’s been working well. But how can we make it happen to compute with two decimals and not auto-round it off. It’s important for us to know the exact age.

Thanks!

To get a result with 2 decimals, use FormatNumber(<Your_Number>; 2).

3 Likes