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 / powerautomate sharepoi...
Power Automate
Suggested Answer

powerautomate sharepoint list count each items

(0) ShareShare
ReportReport
Posted on by 6

Dear Team,

In SharePoint, I have a list that contains the following fields:

  • Customer Name
  • Phone Number
  • Account Number
  • Date Created

This list is filled by the call center team.

I would like to create a Power Automate flow that runs on a daily basis and checks how many times the same customer account number is repeated on the same day. If the same account number appears 3 times or more in one day, the flow should send me an email notification so I can follow up with the customer and understand why they are calling frequently.

For example, this is the data I have in the SharePoint list:

  • Name: John | Phone Number: 365252 | Account Number: 123456 | Date Created: 24.05.2026
  • Name: John | Phone Number: 365252 | Account Number: 123456 | Date Created: 24.05.2026
  • Name: John | Phone Number: 365252 | Account Number: 123456 | Date Created: 24.05.2026
  • Name: John | Phone Number: 365252 | Account Number: 123456 | Date Created: 17.05.2026
  • Name: Peter | Phone Number: 242324 | Account Number: 456789 | Date Created: 03.05.2026
  • Name: Michael | Phone Number: 324234 | Account Number: 5552523 | Date Created: 05.04.2026

In this case, the flow should send me an email notification for John because his account number was repeated 3 times as of today

Could you kindly guide me on:

  1. Which type of Power Automate flow I should create?
  2. How to count repeated account numbers per day?
  3. What steps and actions I should use to achieve this requirement?

Thank you.

 
Categories:
I have the same question (0)
  • Suggested answer
    Pstork1 Profile Picture
    69,556 Most Valuable Professional on at
    1) A recurrence flow set to run at a specified time daily
    2) Use Get Items with pagination enabled to retrieve all the records in the SharePoint list Modified in the last 24 hours, Order the records by Account Number
    3) Initialize a String Variable and a Count Variable
    4) Loop through each item and check to see if the account number matches the one stored in the variable.
          - If it matches then increment the Count variable
          - If it doesn't match, See if the Count is 3 or greater
                    - if the count is 3 then send an email, set the count to 0, and save the account Number to the variable otherwise
                    - set the count to 0, and save the account Number to the variable

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • CU17012005-0 Profile Picture
    6 on at
     
    3) Initialize a String Variable and a Count Variable
     
     
    do you mean i have to choose compose?  if yes what should i write ?
  • Suggested answer
    Pstork1 Profile Picture
    69,556 Most Valuable Professional on at
    @CU17012005-0 No, you need to use two Initialize Variable actions.  One to create a string variable to hold the previous account number checked and another to hold how many matches you found.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • CU17012005-0 Profile Picture
    6 on at
    thank you brother for your help just one more thing if you could do.  can you send me screen shots with the step?  i am new in power automate and i got lost in youtube world just looking for a solution for my problem
  • Suggested answer
    Pstork1 Profile Picture
    69,556 Most Valuable Professional on at
  • CU17012005-0 Profile Picture
    6 on at
    Than you boss for you assistance 
    I am almost there
     
    One last question what should I write inside the inititialize variable?
     
     
  • Pstork1 Profile Picture
    69,556 Most Valuable Professional on at
    You are just initializing variables you will use later in the list.  So you don't need to add much of anything.
    Then later when looping through the records you use one to save the previous account number when it changes and the other to count the number of times the account number appears in the list.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • Chriddle Profile Picture
    8,708 Super User 2026 Season 1 on at
    This Select counts the amount of records for each Account Number:
     
     
    From:
    xpath(
    	xml(
    		addProperty(
    			json('{}'),
    			'Root',
    			addProperty(
    				json('{}'),
    				'Item',
    				outputs('Compose-Data')
    			)
    		)
    	),
    	'//Item[not(accountNumber = preceding-sibling::Item/accountNumber)]/accountNumber/text()'
    )
     
    Map accountNumber:
    item()
    Map count:
    xpath(
    	xml(
    		addProperty(
    			json('{}'),
    			'Root',
    			addProperty(
    				json('{}'),
    				'Item',
    				outputs('Compose-Data')
    			)
    		)
    	),
    	concat('count(//Item[accountNumber = "', item(), '"])')
    )
     
     
  • Suggested answer
    David_MA Profile Picture
    14,956 Super User 2026 Season 1 on at
    Have you resolved your issue? If so, please be sure to mark the solution you used. If you have not figured out what to do, I would offer I slight variation based mostly on the other posts. 
     
    • Use a get items action with a filter query to get the items from the past 24 hours as others have suggested.
    • Use a select action to choose only the Account Numbers:
    • Then use a union expression to get the unique account numbers (union(body('Select'), body('Select'))):
    • Then use an apply to each on the output of the action that does the union:
    • Then use another get items action with a query filter on the account number. Note, your filter query will also need to include an and clause to only get items created in the past 24 hours.
    • Add a condition and use a length expression to see if three or more items with the account number are found and put the e-mail action on the yes side:
    As others have said be sure to turn on pagination if you expect that there could be more than 100 items returned by the Get items actions. By default, they will only return the first 100 items.

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!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard