web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Send an e-mail at x5 roll-up column

(0) ShareShare
ReportReport
Posted on by 58

Hello,

 

for a solution, I need to build an automated e-mail send.
This on the contact entity, each time, when a roll-up column hits 5.
So when it adds up to 5, the e-mail needs to be sent.
But also at 10, 15, 20, ...

The e-mail template will always be the same, only do I need put that Roll Up column on the template

 

Any suggestions?

I have the same question (0)
  • Verified answer
    Nya Profile Picture
    29,064 on at

    Hi Serge Pilaet,

    First of all, a rollup field cannot be used to trigger a flow or workflow.

    So you need to create a new field and set a business rule for it to pass the value of the rollup field to it.

    For example, there is a rollup field to count the number of the contacts named as "Count of contacts"/ "new_countofcontacts".

    The new field is named as "Count of contacts1"/ "new_countofcontacts1", whose value equals to the value of the rollup field.

    pastedimage1639730065139v1.png

    Then create a flow triggered when the new field is modified.

    pastedimage1639730209966v2.png

    Initialize it as a variable.

    pastedimage1639730248677v3.png

    Add a condition to send an email if this variable is divisible by 5. The variable can be inserted into the content of the email directly.

    pastedimage1639730360759v4.png

    Then when the count of the contacts hits 5, the email address of the account will receive a notification email.

    pastedimage1639730469762v5.png

  • SergeP Profile Picture
    58 on at

    Hello Nya, 

    Already a big thumbs up for your fast and great answer. Helped me already a lot. You are great.

    Now I have been building and have a couple questions left.

    I got an error, given the variable isn't initialized. But this is done in the previous step.

    Request to XRM API failed with error: 'Message: Flow client error returned with status code "BadRequest" and details "{"error":{"code":"InvalidOpenApiFlow","message":"Flow save failed with code 'InvalidVariableOperation' and message 'The inputs of workflow run action 'Condition' of type 'If' are not valid. The variable 'Get Number of Games Played' must be initialized before it can be used inside action 'Condition'.'."}}". Code: 0x80060467 InnerError: '.

    pastedimage1639737646319v1.png

    pastedimage1639737706134v2.png

    pastedimage1639739511060v1.png

    Then I had one final question. 

    I would need to send 2 emails, based on the Age of the contact. 
    So a switch would be in order. One if he is <= 15, the other version >15 years.
    We have a calculated field to get the age in years. 


  • Verified answer
    Bipin D365 Profile Picture
    28,985 Moderator on at

    Hi,

    For the first issue you would need to modify the expression -

    Mod(Variable('Initialize_Variable'),5)

    because your variable name is different than given in example by Nya.

    For the second question - you can achieve using Two Condition expression.

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • SergeP Profile Picture
    58 on at

    Thank you Bipin.

    First point OK.

    Second point: of course, why was I thinking of a Switch, where you can just use a second condition and the Yes/No path.

    You helped me as well.

  • SergeP Profile Picture
    58 on at

    OK, we are slowly getting there.

    Error details:

    Unable to process template language expressions for action 'Condition' at line '1' and column '17312': 'The template function 'Variable' is not defined or not valid.'.

    pastedimage1639756448435v1.png

    pastedimage1639756524353v2.png

    pastedimage1639756615136v4.png

  • Suggested answer
    Bipin D365 Profile Picture
    28,985 Moderator on at

    Hi,

    Again same issue, you have modified your variable name to 'Count Initialize Variable' but in your expression you are still using 'Initialize Variable'.

    Please modify your expression as below-

    Mod(Variable('Count_Initialize_Variable'),5)

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Subra Profile Picture

Subra 148

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 99 Super User 2026 Season 1

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 85 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans