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 / Split a string into mu...
Power Apps
Unanswered

Split a string into multi pieces?

(0) ShareShare
ReportReport
Posted on by 997

Hello,

how can i split a string into multi pieces?

Because our data is always different.

I use this in the label on Text:

 

With(
 {
 wMessage: 
 ForAll(Split(Title2_9;Char(10)); {Result: ThisRecord.Value})
 };
If(IsBlank(Title2_9)||IsEmpty(Title2_9); 
 "Where: " & ThisItem.CATEGORY; 
//not empty
 Concat(
 ForAll( 
 ForAll(Split(Title2_9;Char(10)); {Result: ThisRecord.Value}) As inFocus; 
 If(
 Len(Title2_9)=0; Text(inFocus.Result);
 Upper(Left(inFocus.Result;Len(Title2_9)))=Upper(First(wMessage).Result);
 If(First(wMessage).Result ="PICKUP"||First(wMessage).Result ="DELIVERY"||First(wMessage).Result ="RETURN"||First(wMessage).Result ="ON HOLD"||First(wMessage).Result ="APPOINTMENT"; Text(inFocus.Result)
 ;
 ThisItem.CATEGORY &Char(10)& inFocus.Result) ; 
 Left(inFocus.Result;7))); 
 ThisRecord.Value; Char(10))
 ))

 

And it works in normal values but sometimes we have more values (this field has choices) in a sharepoint

So the Title2_9 is a label in the gallery where i load the CATEGORY.

So how can i display the lines we wanna show and not all or mixed up.

Thank you

 

 

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

    It's not 100% clear what your starting data looks like, and what your preferred end look would be from what you have provided, I believe this is why noone has responded

  • TimmyBoy Profile Picture
    997 on at

    Hi @TheRobRush ,

    Hmmm, Okay i have added an image

    TimmyBoy_0-1683855326751.png

    As you can see it shows Pickup, delivery and then the last one has more values
    3 to been exact
    How can i split those and show only the ones i wanna show?
    For this example i only want to show ON HOLD.
    Hope this help you all a little better.

    Thank you

  • TheRobRush Profile Picture
    11,128 Moderator on at

    How would the app know that, of the options, ON HOLD is the one wanted in this situation? Things that have to be planned before hand.

  • TimmyBoy Profile Picture
    997 on at

    Hello @TheRobRush 

    That's a very good question

    I was thinking it can check if lines 1-3 has some data and check if the value match with our suggestions

    Like if line 2 has "APPOINTMENT" it will show appointment
    Like 1 = ON HOLD it shows on hold
    ect....

    Not sure it makes any sense.

  • TheRobRush Profile Picture
    11,128 Moderator on at

    It doesn't yet, but only because you need to flesh out a specific structure of look for this item first, if not then this, if not then this, and have a very specific end point where it just returns a default value if all else fails. It has to be specific or matched against a collection of results somewhere. 

  • TimmyBoy Profile Picture
    997 on at

    Hmm, what about if we cut the 

    Title2_9

    Into piece because it will always ends with a New line Char(10)

    And add them inside a temp collection or anything and then we see if one of those pieces match what we want..

    Or do i just say the same thing as before 😣

  • TheRobRush Profile Picture
    11,128 Moderator on at

    You said same thing as before.

     

    Splitting the string is a given, we know we will do this.

     

    What we need to know is HOW to know which piece we want.

     

    Is user typing it, and if so why not just type it. 

    Is it going down a heiarchy of predetermined options and picking first available.

    It it picking the word with least amount of letters, or the one with the most vowels, or thr most curved letters, possibilities are endless

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard