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 / PAD - Count specific v...
Power Automate
Answered

PAD - Count specific values within a datatable

(1) ShareShare
ReportReport
Posted on by 18
Hi all,
 
This one is driving me mad. It's surely something simple but I am stuck. I hope someone can give me a gentle pointer.
 
I have a desktop flow that connects to a website and extracts data, stores it in a datatable:
 
 
What I want to know is how many times each result appears i.e. count Halliwell Jones Warrington BMW etc.
 
I have a for each loop running for each current item in the datatable, and increases a variable counter +1 for each occurrence, but it doesn't feel dynamic enough as I need one variable per result, and the data may change.
 
What I would like to have is a new data table with one row per result from the above extract, and a second column containing the count. 
 
Does anyone here have any suggestions/

TIA, Mark
Categories:
I have the same question (0)
  • Verified answer
    trice602 Profile Picture
    16,164 Super User 2026 Season 1 on at
    Hi,
     
    Please try adding up each value in the apply to each, it is dynamic and will handle all variations without the need to set up a manual variable.
     
    1. Create Dictionary Variable `CountsDictionary = {}`
    2. For Each `CurrentRow` in `DataFromWebPage`
        a. Set `CurrentValue = CurrentRow['results']`
        b. If `CountsDictionary` contains `CurrentValue`
            - Increment `CountsDictionary[CurrentValue]` by 1
        c. Else
            - Set `CountsDictionary[CurrentValue] = 1`
    3. End Loop
    4. Display `CountsDictionary`
    
     

    ------------------------------------------------

     

     

    ⭐ If this was helpful, please like and mark as a verified answer to help others find this too!

     

     

    Always glad to help! 💯💯💯💯💯

     

    Tom

     

    Follow me on LinkedIn - Thomas Rice, PMP | LinkedIn

  • markhollis Profile Picture
    18 on at
    Thanks for the reply on this.
    Using your guidance and some internal help, I have managed to use what you provided to write this block, and it does exactly what I need it to do with scope to expand it further once additional info is provided:
    Cheers, Mark

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 959

#2
Valantis Profile Picture

Valantis 872

#3
Haque Profile Picture

Haque 589

Last 30 days Overall leaderboard