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 / Power Apps Sort Text b...
Power Apps
Answered

Power Apps Sort Text by line

(0) ShareShare
ReportReport
Posted on by 11

Hi Guys,

                In Power Apps I have a multiline text box and would like to sort the text by the 16th character in each line.  Basically so I get all the “ZIPS”,”CANS” and “FAST” together.  Does anyone know if this is possible?

 

Starting text

ABCD-ABC1-ZYX1-ZIPS-0058-0::100GBE-1

ABCD-ABC2-ZYX2-CANS-0016-0::100GBE-1

ABCD-ABC1-ZYX1-ZIPS-0059-0::100GBE-1

ABCD-CBA1-ZYX1-FAST-0029-0::100GBE-1

ABCD-ABC1-ZYX1-ZIPS-0060-0::100GBE-1

ABCD-ABC1-ZYX1-ZIPS-0061-0::100GBE-1

ABCD-ABC1-ZYX2-CANS-0014-0::100GBE-1

ABCD-CBA1-ZYX1-FAST-0028-0::100GBE-1

ABCD-ABC2-ZYX2-CANS-0015-0::100GBE-1

ABCD-ABC2-ZYX2-CANS-0017-0::100GBE-1

ABCD-CBA1-ZYX1-FAST-0027-0::100GBE-1

ABCD-CBA1-ZYX1-FAST-0030-0::100GBE-1

 

How I would like it to look

ABCD-ABC1-ZYX2-CANS-0014-0::100GBE-1

ABCD-ABC2-ZYX2-CANS-0015-0::100GBE-1

ABCD-ABC2-ZYX2-CANS-0016-0::100GBE-1

ABCD-ABC2-ZYX2-CANS-0017-0::100GBE-1

ABCD-CBA1-ZYX1-FAST-0027-0::100GBE-1

ABCD-CBA1-ZYX1-FAST-0028-0::100GBE-1

ABCD-CBA1-ZYX1-FAST-0029-0::100GBE-1

ABCD-CBA1-ZYX1-FAST-0030-0::100GBE-1

ABCD-ABC1-ZYX1-ZIPS-0058-0::100GBE-1

ABCD-ABC1-ZYX1-ZIPS-0059-0::100GBE-1

ABCD-ABC1-ZYX1-ZIPS-0060-0::100GBE-1

ABCD-ABC1-ZYX1-ZIPS-0061-0::100GBE-1

 

 

Thanks everyone for your assistance

Categories:
  • TheRobRush Profile Picture
    11,128 Moderator on at

    I am on my cell right now so not in a place I can write out a code snippet for you that works, but if noone gets to it by time.i get home I will

     

    This could be done I think using some combination of split() sort() and mid()

     

    Maybe @RandyHayes. wouldnt mind taking a look, but if hes busy too i will get to it in an hr or so

  • Verified answer
    timl Profile Picture
    37,424 Super User 2026 Season 2 on at

    Hi @cbames 

    Assuming that TextInput1 contains your input value, this formula should work for you:

    Concat(
     Sort(
     Split(
     TextInput1.Text,
     Char(10)
     ).Result,
     Right(
     ThisRecord.Result,
     Len(ThisRecord.Result) - 15
     )
     ),
     Result & Char(13) & Char(10)
    )

     

    timl_0-1646267085597.png

     

  • cbames Profile Picture
    11 on at

    That worked beautifully.  Thanks so much

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 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 204 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard