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 :
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
    Manish Solanki Profile Picture
    15,169 Moderator 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
    Manish Solanki Profile Picture
    15,169 Moderator 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 258 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 198 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 136 Super User 2026 Season 2

Last 30 days Overall leaderboard