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 / 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
    15,402 Super User 2025 Season 2 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

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 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard