Skip to main content
Dynamics 365 general forum
Answered

Send an e-mail at x5 roll-up column

editSubscribe (0) ShareShare
ReportReport
Posted on by 50

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?

Attachments
  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,934 Super User on at
    RE: Send an e-mail at x5 roll-up column

    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/

  • SergeP Profile Picture
    SergeP 50 on at
    RE: Send an e-mail at x5 roll-up column

    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

  • SergeP Profile Picture
    SergeP 50 on at
    RE: Send an e-mail at x5 roll-up column

    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.

  • Verified answer
    Bipin D365 Profile Picture
    Bipin D365 28,934 Super User on at
    RE: Send an e-mail at x5 roll-up column

    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
    SergeP 50 on at
    RE: Send an e-mail at x5 roll-up column

    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
    Nya Profile Picture
    Nya 29,043 on at
    RE: Send an e-mail at x5 roll-up column

    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

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,080 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,601 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Featured topics

Product updates

Dynamics 365 release plans