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 / Delete preceeding char...
Power Apps
Answered

Delete preceeding characters

(0) ShareShare
ReportReport
Posted on by 24

In my app, I have a TextInput1  where I paste something like this 

 

RP/OSLAP28BB/OSLAP28BB WS/SU 9MAY23/1805Z XXJEKT
RTN,F,J
1.LASTNAME/FIRSTNAME MR
152 FP CCCA1234567891233009/1227
3 AP 123456789-B
4 AP 123456789-M
5 APA OSL - A
6 APB +123456789 - B
7 APB +123456789 - B / MOBILE
8 APE FIRSTNAME.LASTNAME@SOMEWHERE.COM
9 APE IRSTNAME.LASTNAME@SOMEWHERE.COM
10 APM +123456789
153 AB A1-COMPANY SOLUTIONS AS ICC/A2-

 

How can I, using Onselect of a button, delete 4 first characters of every line (preceeding spaces, digigts etc.) and make edited text show up in TextInput2

 

Thx in advance

Categories:
  • v-hanytian-msft Profile Picture
    Microsoft Employee on at

    Hi @Pacificodk ,

     

    According to your description, we fill in the formula of OnSelect with Button.

    ClearCollect(Col,Right(TextInput1.Text,Len(TextInput1.Text)-4))

    vhanytianmsft_0-1688372142449.png

     

     

    Default of TextInput2.

    First(Col).Value

    vhanytianmsft_1-1688372142451.png

     

     

    Hope this will help you.

     

    Best Regards,

    Tina

  • Verified answer
    WarrenBelz Profile Picture
    156,940 Most Valuable Professional on at

    Hi @Pacificodk

     

    Concat(
     ForAll(
     Split(
     YourTextBox.Text,
     Char(10)
     ),
     Right(
     Value,
     Len(Value) - 4
     )
     ),
     Value,
     Char(10)
    )

    Also this will remove everything before the first space on each line (which I think you may want here)

    Concat(
     ForAll(
     Split(
     YourTextBox.Text,
     Char(10)
     ),
     Right(
     Value,
     Len(Value) - Find(
     " ",
     Value
     )
     )
     ),
     Value,
     Char(10)
    )

    but you are going to need consistency of each line format to do this.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Verified answer
    Ethan_009 Profile Picture
    4,840 Moderator on at

    Hi @Pacificodk ,

     

    @WarrenBelz  1st one would work for you hopefully👍🏻

  • Pacificodk Profile Picture
    24 on at

    Hi Tina...this only deletes first 4 characters of first line - i need to do it to all lines?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard