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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Invoice count to check...
Power Automate
Answered

Invoice count to check for any new items not previously communicated and then send an email if new

(0) ShareShare
ReportReport
Posted on by 212

I currently have a recurring email that goes out to Accounting on a schedule Monday to Friday. It counts the number of invoices that are not paid. So users may get the same email and same count of invoices. I like to enhance this so that only initial so it does not repeatedly send out this email if the count of invoices is the same from yesterday. Do you have any suggestions for improvement. thanks,

 

Here is how it looks right now:

 

Recurrence

Get items: Filter: field_27 eq 'Not Paid' 

Compose to count number of invoice from the Get items: length(body('Get_items')?['value'])

Conditon to check the output is greater then 1
Send an email.
 
mthiru_0023_0-1683138972017.png

 

Categories:
I have the same question (0)
  • Verified answer
    ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @mthiru_0023 

     

    You need to save the count of invoices with dates in the separate SharePoint list. Please follow the below instructions to achieve this:

    1. Create a new SharePoint list, lets say 'Run History'. We will not create any custom columns or fields as we will leverage Title & Created fields for storing count & date.

    ManishSolanki_0-1683172284665.png

     

    2. Next, pls add 2 new actions 'Get Items' and 'Compose' before 'Condition' action in your flow:

    ManishSolanki_1-1683172478782.png

     

    expression used in compose 2 is

    if(empty(outputs('Get_items_2')?['body/value']),0,int(first(outputs('Get_items_2')?['body/value'])?['Title']))

    3. Next, modify the condition to check if count matches with invoice count saved in last record of 'Run History' list:

    ManishSolanki_2-1683172651439.png

     

    4. Finally, we need to save the count in 'Run History' list in case the count is mismatched, for that we will add 'Create Item' action in 'Yes' path before sending an email:

    ManishSolanki_3-1683172785384.png

     

    The whole flow will look like this:

    ManishSolanki_4-1683172998573.png

     

     

    If it solves your problem, then please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • Verified answer
    ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @mthiru_0023 

     

    You need to save the count of invoices with dates in the separate SharePoint list. Please follow the below instructions to achieve this:

    1. Create a new SharePoint list, lets say 'Run History'. We will not create any custom columns or fields as we will leverage Title & Created fields for storing count & date.

    ManishSolanki_0-1683172284665.png

     

    2. Next, pls add 2 new actions 'Get Items' and 'Compose' before 'Condition' action in your flow:

    ManishSolanki_1-1683172478782.png

     

    expression used in compose 2 is

    if(empty(outputs('Get_items_2')?['body/value']),0,int(first(outputs('Get_items_2')?['body/value'])?['Title']))

    3. Next, modify the condition to check if count matches with invoice count saved in last record of 'Run History' list:

    ManishSolanki_2-1683172651439.png

     

    4. Finally, we need to save the count in 'Run History' list in case the count is mismatched, for that we will add 'Create Item' action in 'Yes' path before sending an email:

    ManishSolanki_3-1683172785384.png

     

    The whole flow will look like this:

    ManishSolanki_4-1683172998573.png

     

     

    If it solves your problem, then please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • mthiru_0023 Profile Picture
    212 on at

    @ManishSolanki , Hi thanks for the response. 

    I am testing your proposed solution. The Compose results in 0 inputs and outputs so the flow does not trigger the event based on the AND condition. Any advice?

    mthiru_0023_0-1683552205239.png

    mthiru_0023_1-1683552215723.png

     

  • mthiru_0023 Profile Picture
    212 on at

    @ManishSolanki , please disregard. This solution works. 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard