cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ccomins
Level 8

CountRows that contain or start with specific text

I have a collection with two columns... FileName and Image.

 

Presently I collect the different types of images seperately and use Concatenate to populate the file names with CountRows function included...

Collect(AuditPhotos,{ImageSmiley FrustratedtoreFrontIMG.Image,FileName:Concatenate("Store Front_",DataCardValue123.Text,"(",Text(CountRows(AuditPhotos)),").jpg")})
Collect(AuditPhotos,{Image:FleetIMG.Image,FileName:Concatenate("Fleet_",DataCardValue123.Text,"(",Text(CountRows(AuditPhotos)),").jpg")})

There are 11 different types of photos with multiple photos of each type. Each type of photo will have a different FIleName. I want to filter the CountRows function to only count rows where the FileName starts with or contains specific text. ie starts with or contains "Store Front". That way if there are 3 photos of the store front they will look like Store Front_xxxx(0), Store Front_xxxx(1), StoreFront_xxxx(2). The Store back would then be... Store Back_xxxx(0), Store Back_xxxx(1), Store Back_xxxx(2),ect...

 

I have been unsuccessfull in my attmpts thus far. Any help is appreciated. 

Thank you.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
NMCLEOD
Level: Powered On

Re: CountRows that contain or start with specific text

Hi ccomins, I've done something similar before (was a Concatenate with CountIf).  I've tried to mockup what the syntax would probably look like for you, see below:

 

...FileName:Concatenate("StoreFront_", DataCardValue123.Text, "(", CountIf(AuditPhotos, StartsWith(FileName, "Store Front") || "Store Front" in FileName),")", ".jpg")

 

Something like this should work to count the relevant rows in your collection. NB. Showing two methods to get the relevant rows (Starts With and In) you might only need 'In'.

 

Hope this helps solve it, if so please hit 'Accept as Solution.

2 REPLIES 2
NMCLEOD
Level: Powered On

Re: CountRows that contain or start with specific text

Hi ccomins, I've done something similar before (was a Concatenate with CountIf).  I've tried to mockup what the syntax would probably look like for you, see below:

 

...FileName:Concatenate("StoreFront_", DataCardValue123.Text, "(", CountIf(AuditPhotos, StartsWith(FileName, "Store Front") || "Store Front" in FileName),")", ".jpg")

 

Something like this should work to count the relevant rows in your collection. NB. Showing two methods to get the relevant rows (Starts With and In) you might only need 'In'.

 

Hope this helps solve it, if so please hit 'Accept as Solution.

ccomins
Level 8

Re: CountRows that contain or start with specific text

Thank you. That is exactly what I needed.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 71 members 4,236 guests
Please welcome our newest community members: