cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DrinkWater
Level: Powered On

Can Microsoft Flow count strings?

Hi. All.

 

I want to extract and count strings from the SharePoint list.

For example, it looks like this.

 

asfweabcgfrthoabcopfgrkpabc

Count how many "abc" are in this string.

You can see if you look at it, but the answer is 3.

 

In Excel, you can use the CountIf function, but in Microsoft Flow, what do you do if you want to do something like that?

 

Thanks.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Can Microsoft Flow count strings?

Hi @DrinkWater 

 

I used the split and length expressions to do this. Please see the screenshot below: splai.PNG

Expression: sub(length(split(variables('tesat'),'abc')),1)

Split function splits the string and creates a new array. Then we count the elements of that array and finally subtract 1 from that (indexing) to get the total number of instances of the string match. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

2 REPLIES 2
Dual Super User
Dual Super User

Re: Can Microsoft Flow count strings?

Hi @DrinkWater 

 

I used the split and length expressions to do this. Please see the screenshot below: splai.PNG

Expression: sub(length(split(variables('tesat'),'abc')),1)

Split function splits the string and creates a new array. Then we count the elements of that array and finally subtract 1 from that (indexing) to get the total number of instances of the string match. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

DrinkWater
Level: Powered On

Re: Can Microsoft Flow count strings?

Hi, @yashag2255 

Wow! It's amazing.

I did not think that I could do something like this.

Thank you for teaching me.

This thread is closed.

And I'm sorry. I was able to do something new to listen to.

Also, it would be helpful if someone could tell me.

 

https://powerusers.microsoft.com/t5/Building-Flows/Find-a-string-and-put-letters-before-and-after/m-...

Helpful resources

Announcements
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,133)