Hi Powerapps community,
I have a text label in gallery which has a text :
PlayGroup(Level 2):Shorts:Size:10:Qty:4:KitFee:4500
Total Amount:18400
Now I want to use regex to get 18400 from above text using regex.
My formula:
Last(
Split(
Match(
ThisItem.ClassOrdered,
"PlayGroup\(Level 2\):.*Amount:(\d+)"
).FullMatch,
":"
)
).Value
but above formula is giving error. The starting of regex PlayGroup\(Level 2\): will get changed based on class so this can be considered as starting delimiter. The Amount keyword remain same and amount after that can be different.
I would appreciate any help.
Regards,
R
Hi @v-hanytian-msft ,
thankyou for the reply.
I guess I didn't explain better in my question
The text can be :
PlayGroup(Level 2):Shorts:Size:10:Qty:5:KitFee:5500
Total Amount:27500
*************************
Nursery(Level 3):Shorts:Size:11:Qty:20:KitFee:5500
Total Amount:110000
*************************
LKG(Level 4):Shorts:Size:12:Qty:20:KitFee:5500
Total Amount:110000
*************************
UKG(Level 5):Shorts:Size:12:Qty:9:KitFee:5500
Total Amount:49500
Now If I apply PlayGroup class filter then it should show number after amount(27500) from PlayGroup(Level 2) group of text and if I apply Nursery class filter then amount(110000) from Nursery(Level 3) group of text and same process for other class filter.
That's why in my question I used PlayGroup at start of regex so it finds that keyword and then the following number after Amount.
I hope I explained now.
Thanks
Hi @r_voyager ,
Please try this:
Last(
Split(
Match(
ThisItem.ClassOrdered,
"Amount:(\d+)"
).FullMatch,
":"
)
).Value
Hope this will help you!
Best Ragards,
Tina
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2