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 / Power Automate Desktop...
Power Automate
Answered

Power Automate Desktop, Count specific values from list

(0) ShareShare
ReportReport
Posted on by 12

Hello everyone,

 

In one part of a long flow, I have long lists of tools, and I need to calculate how many of each tool are in those lists. For example, in my list of 200 vehicles, I need to calculate how many Volvos and how many Fiats there are by scanning the list items. In the last ı must write the conclusion to the excel like 71 volvo, 57 Fiat etc. I am using Power Automate Desktop.

 

Thanks in advance

  • Verified answer
    CU16071609-1 Profile Picture
    6,255 Moderator on at

    @GucluGunduz 

    Please follow the suggested actions:

    Search for occurrences of the text "Volvo" within the "List" using "Parse Text" Action as mentioned as below.

    Deenuji_1-1709802452350.png

    Displaying/Get the counts of occurrences for "Volvo" use "%VolvoList.Count%"

     
     
  • Verified answer
    CU16071609-1 Profile Picture
    6,255 Moderator on at

    @GucluGunduz 

    Please paste the following code into your PAD designer. It should function correctly.

     

    Code:

     

    Text.ParseText.Parse Text: ToolList TextToFind: $'''Volvo''' StartingPosition: 0 IgnoreCase: False OccurrencePositions=> VolvoList
    Text.ParseText.Parse Text: ToolList TextToFind: $'''Suzuki''' StartingPosition: 0 IgnoreCase: False OccurrencePositions=> SuzukiList
    Display.ShowMessageDialog.ShowMessage Title: $'''Count''' Message: $'''Volvo: %VolvoList.Count%
    Suzuki: %SuzukiList.Count%''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed

     

    If my response addresses your concern, please consider marking it as the solution  and giving it a thumbs up. This helps others in the future and also serves as motivation for me. Thank you!

     

  • GucluGunduz Profile Picture
    12 on at

    Thank you for your help 

    Instead of display messege, I need to print the result to Excel, so can you share a screenshot so that the settings are visible? Excel data: 72 Volvo, 57 Fiat, 43 Suzuki

  • CU16071609-1 Profile Picture
    6,255 Moderator on at

    @GucluGunduz 

    Here you go!!

    Deenuji_0-1709811419265.png

     

    Deenuji_1-1709811435365.png

    Code:

    Text.ParseText.Parse Text: ToolList TextToFind: $'''Volvo''' StartingPosition: 0 IgnoreCase: False OccurrencePositions=> VolvoList
    Text.ParseText.Parse Text: ToolList TextToFind: $'''Suzuki''' StartingPosition: 0 IgnoreCase: False OccurrencePositions=> SuzukiList
    Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''C:\\Users\\deenu\\OneDrive\\Documents\\result.xlsx''' Visible: True ReadOnly: False Instance=> ExcelInstance2
    Excel.WriteToExcel.WriteCell Instance: ExcelInstance2 Value: $'''%VolvoList.Count% Volvo''' Column: $'''A''' Row: 1
    Excel.WriteToExcel.WriteCell Instance: ExcelInstance2 Value: $'''%SuzukiList.Count% Suzuki''' Column: $'''B''' Row: 1
    Excel.SaveExcel.Save Instance: ExcelInstance2

     

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

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 432

#2
11manish Profile Picture

11manish 313 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 154

Last 30 days Overall leaderboard