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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / String Manipulation
Power Apps
Answered

String Manipulation

(0) ShareShare
ReportReport
Posted on by 353

Hello everyone,

 

i am trying to cut off some text from a text label, this text label produces a "string type" number sequence. 

 

for example it will produce a 30-02-03, how can i cut off "-02" that way 30-03 is left. 

 

what i am trying to do:

i am trying to create a custom id for each item that gets created with follow up requests that link, for example, a frist go through of a request will be 30-01, second request will be a follow up so 30-02, then 30-03 and so on, 

 

thanks !

 

 

Categories:
I have the same question (0)
  • KLatch Profile Picture
    57 on at

    Using a combination of the Left and Right functions will likely get you what you are looking for by the sounds of it.

     

    Label1.Text = "30-02-03"
    
    Label2.Text = Left(Label1.Text,2) & Right(Label1.Text,3)

    This results in "30-03" in Label2

     

    Hope this helps.

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @mmattar,

    Do you want to cut off the "-02" from the "30-02-03" text string value?

    Based on the needs that you mentioned, I think the Split function and Concatenate function could achieve your needs.

    I have made a test on my side, please take a try with the following workaround:4.JPG

    Set the Text property of the Label control to following:

    Concatenate(
    First(Split(Label1.Text,"-")).Result, /* retrieve 30 */
    "-",
    Last(Split(Label1.Text,"-")).Result /* retrieve 03 */
    )

    More details about the Split function and Concatenate function in PowerApps, please check the following article:

    Split function

    Concatenate function

     

    Best regards,

    Kris

  • TimRohr Profile Picture
    669 on at

    In case it is not obvious, @KLatch's solution is quick and gets the job done assuming you always have 2 digit first and last components to your numbering.

     

    @v-xida-msft's solution is forward scalable to any length of text delineated by the hyphen... assuming you always have a hyphen.

     

    If you have cases that would break those assumptions, post back with fuller rules of generating your initial data.

  • PytByt Profile Picture
    943 on at

    Hi @v-xida-msft 

    What should i do if i want to get these text separated into 3 part? (separated with number inside the bracket) and put it into a different label.

     

    I need to split it into 3 part based on the (01), (17), and (10)I need to split it into 3 part based on the (01), (17), and (10)
    I also want to take the middle part, which is 220228.

     

    I already try with split function for the container label in label.text property:
    Split(Label1.Text, "(10)").Result  but it return error with error message: Expecting text value.

     

    Can you help me achieve these?

    Thanks,
    pytbyt

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard