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 / Count the number times...
Power Automate
Answered

Count the number times a specific character appears in a text string in Power Automate

(0) ShareShare
ReportReport
Posted on by 43

Hi All, 

I'd like to know the simplest way to count how many times a / appears in different strings e.g. : 

 

/Folder/Folder2/Folder3/Folder4

/Folder/Folder2/Folder3/Folder4/Folder5/Folder6

/Folder/Folder2/Folder3/Folder4/Folder5

/Folder/Folder2/Folder3/Folder4/Folder5/Folder6/Folder7/Folder8

 

Thanks in advance

 

Categories:
I have the same question (0)
  • Verified answer
    SkoolZ Profile Picture
    43 on at

    I have figured it out by using this expression : 

    length(split(variables('FilePath'),'/'))

     

    It splits the text into sections where the / is and then counts the splits. So I end up with 

     

    /Folder/Folder2/Folder3/Folder4  = 4 sections

    /Folder/Folder2/Folder3/Folder4/Folder5/Folder6 = 6 sections

    /Folder/Folder2/Folder3/Folder4/Folder5 = 5 sections

    /Folder/Folder2/Folder3/Folder4/Folder5/Folder6/Folder7/Folder8 = 8 sections

     

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

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 594

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 281 Super User 2026 Season 1

Last 30 days Overall leaderboard