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 occurrences of a...
Power Automate
Answered

Count occurrences of a character in a string

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I've got a billion (not literally) files to iterate over and I keep finding that I don't have as much control as I think I do.

 

My files are named with the following nomenclature: NOTE.(lastname).(firstname).(Type).(Date)

Note.Deer.John.Type.2021-10-28

 

My goal is to count the number of occurrences of a period " . " to make sure that the Flow that produced this file:

1. Named it correctly (I don't have any control over that between Flow sending the file to OneDrive and it hitting someone's Outlook inbox...)

2. There are an appropriate number of pieces to take out of the string so that PAD won't blow itself up with an error. (Assuming someone's fingers have been all over the file name... or the origination of the file failed to correctly name the file.)

 

I've resigned myself to simply taking the string apart piecemeal for each iteration to isolate what data I need, again, piecemeal. If the string contains different aspects each time it'll be impossible to design one flow to iterate every possible combination of strings. I don't want to manually review all these files one at a time to make sure they're made of the right components. Instead I want to be able to pick out the ones are "complete" and disregard the ones that aren't.

 

Desired result:

Note.John Deer.Type.2021-11-19 (Would be ignored)

Note.Jane.Doe.Type.2021-10-27 (Would get picked up and iterated)

 

Any idea how to make this happen in PAD?

I have the same question (0)
  • Verified answer
    Highboy Profile Picture
    1,185 Super User 2024 Season 1 on at

    You could use "Parse text" 
    %Positions.count% would tell you how many . you have in your filename

    Highboy_0-1637374604624.png

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Dope! I'll give it a try. Thanks for the aid, Highboy!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Works like a charm!

     

    I've got my flow working for me now rather than against me! Thanks again, Highboy!!!

  • elisem Profile Picture
    18 on at

    This was so much easier in SharePoint Designer 😞

  • Ventit Profile Picture
    422 on at

    Where do I find the parse text action?  It i snot in my flow list that I can find

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    It is an action in desktop flows. Are you sure you're using Power Automate Desktop?

  • Ventit Profile Picture
    422 on at

    Thanks,  no I do not use Desk Top Flows.  I did find an answer based on split()

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 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard