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 Apps / count frequency of spe...
Power Apps
Answered

count frequency of specific character in a string

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Firstly: this question probably sounds similar to this one.

But that query could not answer my question as far as I could tell. 

 

I have a table which uses a projectCode column to establish whether a given record is a parent, child or subchild. 

 

Parent entries are denoted as a number, eg 6. 

 

Child entries are denoted as a number, a comma and then another number. Eg 6,8. 

 

Subchild entries follow this theme, with 2 commas. Eg 6,8,3. 

 

It would be useful for me to use 'number of commas in projectCode' logic to establish whether a given item is a parent, child or subchild in powerapps, but I can't figure out how to do this. Ideas? Thanks!

Categories:
I have the same question (0)
  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    @Anonymous 

    My suggestion would be to use SPLIT to change the Text data into a single column table and then COUNTA the rows.

     

    CountA(Split(TextInput1.Text,","))-1

     

    It just so happens I responded to a similar question last night so the code was still available in my forum testing app.

    https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Replacing-a-string-with-mutiple-commas-by-a-single-comma-using/m-p/407092#M119751

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Perfect-thank you!

  • mdevaney Profile Picture
    29,991 Moderator on at

    @Anonymous 

    No problem at all.  If my post solved your issue please mark it as the Solution to close the thread.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Unfortunately I had to re-upload the (static excel) data this afternoon and now each 'split' function is presenting an 'invalid argument' error. I tried formatting all ID_numbers as text in excel but this did not solve the issue. And using text() to wrap the function like below simply meant that the split() function was ignored/not executed:

     

    CountA(Split(Text(TextInput1.Text),","))-1

    Also, entering '.text' at the end of textInput1 in your example did not make it a valid argument type. This is just a column of plain text values...do you know what's going on? Thanks. 

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 Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard