web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : zHcu7reW2yvznUdL7FjJb+
Power Apps - Building Power Apps
Unanswered

How to extract a specific number from a text label in gallery using regex

Like (0) ShareShare
ReportReport
Posted on 12 Jul 2023 08:13:03 by 130

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

  • r_voyager Profile Picture
    130 on 12 Jul 2023 at 08:49:55
    Re: How to extract a specific number from a text label in gallery using regex

    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

  • v-hanytian-msft Profile Picture
    Microsoft Employee on 12 Jul 2023 at 08:30:01
    Re: How to extract a specific number from a text label in gallery using regex

    Hi @r_voyager ,

     

    Please try this:

    Last(
     Split(
     Match(
     ThisItem.ClassOrdered,
     "Amount:(\d+)"
     ).FullMatch,
     ":"
     )
    ).Value

     

    vhanytianmsft_0-1689150567325.png

     

    Hope this will help you!

     

    Best Ragards,

    Tina

     

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete