Skip to main content

I created an Age field and want it to automatically update based on the Patient's DOB (CRM)

This guide shows how to create a workflow that automatically updates the Age field from the Date of Birth. Once set up, it calculates and updates age whenever the account record is updated and a Date of Birth exists.

  • Before You Begin:

    • Ensure you have administrator access to CRM Settings and Workflows.

    • Confirm the Date of Birth and Age fields already exist in the Accounts module.

    • Make sure you have permission to create and edit workflows.

  • Steps:

    1. Navigate to Settings → Workflows.
      ​

    2. Click New Workflow.
      ​

    3. Enter a Workflow Name (e.g., “Auto Update Age”).
      ​

    4. Select the Target Module "Accounts"

    5. Select the trigger condition “Account Updated.”
      ​

    6. The recurrence should be "Every time conditions are met"

    7. Configure the condition:

      • Select Date of Birth as the field.

      • Set the condition to “is not empty.”
        ​

    8. Click Add Action.
      ​

    9. Select Update Fields as the action type.
      ​

    10. A pop-up window will appear, and you should select the following:

      • Add the "Action Title"

      • Choose Age as the field to update.
        ​

    11. In the value section, select Expression instead of a fixed value.
      ​

    12. Configure the expression to calculate age based on the Date of Birth field as listed below

      • (time_diffdays(birthday))/365
        ​

    13. Click Save to confirm the action.

    14. Click Save again to save the workflow configuration.

  • Expected Result:

    • When an account record is updated, and the Date of Birth field contains a value, the Age field automatically calculates and updates.

    • The workflow appears as Active in the Workflows list.

  • Common Errors:

    • Age field not updating:

      • Confirm the workflow is active.

      • Verify the condition is set to “Date of Birth is not empty.”

      • Check that the expression is properly configured.

    • Unable to create workflow:

      • Confirm you have administrator permissions.

    • Expression not saving:

      • Ensure the correct field reference is used in the formula.

  • Related Resources:

Did this answer your question?