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 / Easy way to count stri...
Power Automate
Answered

Easy way to count strings in a string

(0) ShareShare
ReportReport
Posted on by 225

I need a way to count small strings inside a larger string. It looks like I can write a separate flow, passing in the two strings, returning a count. It seems there may be several ways to do this but basically find the first one, increase the count, look from that point on until no longer find, return the count. Should I pursue this method, or is there an easier way?

I have the same question (0)
  • LogicSmith Profile Picture
    225 on at

    I did find the below post, which used an expression to find the number of strings, but it apparently only works in a cloud flow, not in a desktop flow. Otherwise this would be a perfect and creative way to count the strings. 

    Solved: Can Microsoft Flow count strings? - Power Platform Community

  • LogicSmith Profile Picture
    225 on at

    Found one way to do it, just duplicate that one line of formula in the cloud version.

    Split the string, using the text I want to count
    Put the resulting list .count into a variable
    Decrement it by 1

     

    I think this should work, will know for sure after I run it tomorrow morning.

  • Verified answer
    VJR Profile Picture
    7,635 on at

    - Use the "Parse Text" Action

    Make sure to use all occurrences.

    VJR_0-1658975876646.png

     

    And the Positions.Count will give you the exact count

     

    VJR_1-1658975952813.png

     

  • LogicSmith Profile Picture
    225 on at

    That's brilliant - thanks! I had looked at the Parse action but did not connect the find all with it returning a list of positions rather than just a single position.

     

    Someone really needs to write a definitive book about this product. Like the O'Rielly books for developers...

  • GayathriB28 Profile Picture
    4 on at

    That's a Good Idea!

    But, I hardly find a way to recognize the count of the strings in a string in Power Automate Cloud flow

    Can anybody help me with this query in Power automate Cloud?

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 223

#2
David_MA Profile Picture

David_MA 195 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 167

Last 30 days Overall leaderboard