Skip to main content

How to Create an Age Calculation Workflow Using Date of Birth (CRM)

This guide shows you how to set up an automated workflow that calculates a person's age based on their date of birth. The workflow will automatically update the age field whenever a date of birth is entered or modified.

Before You Begin

  • Ensure you have administrator access to CRM Settings and Workflows

  • Verify that you have an Age field in your module (if not, you'll need to create one first)

  • Make sure you have permission to create and edit workflows

Steps

  1. Create an Age field (if it doesn't exist):
    Go to Settings > CRM Settings > Module Management > Module Layout and Fields and add a Number field called "Age" if you don't already have one.
    ​


    ​

  2. Navigate to Workflows:
    Go to Settings > CRM Settings > Workflows


  3. ​Create a New Workflow:
    Click "New Workflow"

  4. Set Workflow Details:

    • Enter a descriptive Workflow Name (e.g., "Auto Calculate Age from DOB")

    • Select your Target Module (e.g., "Accounts", "Leads", etc.)

    • Set recurrence to "Every time conditions are met"

    • Choose the trigger condition: "Date of birth" Is not empty

  5. Add the Workflow Action:

    • Click "Add Action"

    • Select "Update Fields" as the action type

    }

  6. Configure the Field Update:

    • Add an "Action Title" (e.g., "Calculate Age")

    • Choose "Age" as the field to update

    • In the value section, select "Expression" instead of a fixed value

  7. Enter the Age Calculation Formula:
    In the expression field, enter the following formula:

    (time_diffdays([{Accounts.Date of Birth}]))/365
    ​

    NOTE: Replace "[Date of Birth]" with the exact name of your date of birth field as it appears in your module.

  8. Save the Action:
    Click "Save" to confirm the expression update.

  9. Save the Action:
    Click "Save" to confirm the field update action.

  10. Save the Workflow:

    Click "Save" again to save the entire workflow configuration.

Verification / Expected Result

After setting up the workflow:

  • The workflow appears as "Active" in your Workflows list

  • When a record is created or updated with a Date of Birth value, the Age field automatically calculates and updates

  • The age will be calculated as the difference between the current year and the birth year

Troubleshooting / Common Errors

Age field not updating:

  • Confirm the workflow is set to "Active"

  • Verify the trigger condition is set to "Date of Birth" is not empty

  • Check that the field name in the formula exactly matches your Date of Birth field name

  • Ensure the expression syntax is correct: (time_diffdays([{Accounts.Date of Birth}]))/365

Unable to create workflow:

  • Confirm you have administrator permissions

  • Verify both Age and Date of Birth fields exist in your module

Formula not saving:

  • Double-check that you're using "Expression" instead of a fixed value

  • Ensure the Date of Birth field name is spelled exactly as it appears in your module

Related Resources

Did this answer your question?