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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Text.Label - How to re...
Power Apps
Unanswered

Text.Label - How to remove all characters between curly brackets? - MatchAll and substitute/replace

(0) ShareShare
ReportReport
Posted on by

Hi all

I've got a label getting text from gallery.issue_descriptiontext and I would like to replace * and all text between curly brackets, and include curly brackets, with blank.

this is an example of the text :

*instructions:
* Enter with appID on  system Ocn page 
* Expand system Ocn 1

{color:#00875a}* Result:* 434113{color}
Expand system Ocn 32

{color:#de350b}* Result:* 432323{color}
Expand system Ocn 43
 access denied red banner

*Note:*

 
Can someone please show me how to do this with matchAll regex and Sub or another way?

Thanks
Melkor

 



 
Categories:
I have the same question (0)
  • TheRobRush Profile Picture
    11,128 Moderator on at

    Ok so, unfortunately I can't get this all done in a single textbox or label, it's a bit past where I am at currently.

     

    HOWEVER I can get this done as an action. I placed the text to look at in a label (Label2) but can look at it anywhere.

     

    All this code I place in a button

     

    ClearCollect(ogData,Label2.Text);
    ClearCollect(theMatches,
    DropColumns(
    MatchAll(
     Label2.Text,
     "\{"&MultipleNonSpaces&"\}")
    ,"SubMatches", "StartMatch"));
    ForAll(Sequence(CountRows(theMatches)),
     Patch(ogData,First(ogData),{Value:Substitute(First(ogData).Value,Last(FirstN(theMatches,ThisRecord.Value)).FullMatch,"")}))

     

    It goes through and finds every time { } occurs, stores them, then goes back through and changes original info

     

    so if you execute that on say the button that loads each item, it would work and then you just display

     

    First(ogData).Value

     

    instead of the data directly.

     

    If there is a way to do this all in just a single text display control someone like @RandyHayes would probably know

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard