Skip to main content

Notifications

Announcements

No record found.

Power Platform integration forum
Answered

Flow that counts the number of Emails on a record

Posted on by 33
Good Morning,
 
I need some help recreating a Flow.
I need to create a Flow that counts the number of emails connected to a specific record (Regulatory case in this case).
I have tried using CoPilot and it's not helpful at all.
 
Here is the scenario.
1. Customer sends an email to us and the system creates a record called a "Regulatory Case". The email is attached to the Regulatory Case.
2. A Flow runs, counts the emails on the Regulatory Case (in this case it's only one (1) ) and updates a field called 'Number of Emails on Regulatory Case' to 1.
3. Customer sends a follow up email, the Flow runs again, and updates the 'Number of Emails on Regulatory Case' to 2.
 
Here is what I have so far:
 
 
Then when I try and get the Regulatory Case that the email is attached to, I can't find the unique Id for the Regulatory Case (Red Box). The Red Arrow shows that I am trying to reference the Regulatory Cases Table.
 
 
The Row Id shows that there is no unique id for the Regulatory Case the email is connected to. The Red Arrow shows I was searching for the Regulatory Case but there is no unique id for the Regulatory Case:
 
 
How do I:
1. Get the Regulatory Case the email is connected to.
2. Count the number of emails connected to that Regulatory Case
3. Update the field 'Number of Emails on Regulatory Case' with the count of all the emails on this Regulatory Case.
 
Thank you
Shawn Low
 
  • Verified answer
    Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Flow that counts the number of Emails on a record
    Hi,
    1. Get the Regulatory Case the email is connected to.
    The Email 'Regarding' column store this case, you can put 'Regarding(Value)' into 'Row ID'.

    2. Count the number of emails connected to that Regulatory Case
    You need use 'List rows' and 'Initialize variable' actions:


    3. Update the field 'Number of Emails on Regulatory Case' with the count of all the emails on this Regulatory Case.


    I hope you can mark my answer verified if it answer your question! If you have any questions, please feel free to contact me.
    Regards,
    Leah
     

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,459 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,783 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Product updates

Dynamics 365 release plans