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 concatenated s...
Power Apps
Unanswered

Split a concatenated string out of a selected Sharepoint record

(0) ShareShare
ReportReport
Posted on by 147

Hello, I am hoping someone can help me with the following. 

 

I created a string variable in order to have multiple inputs from a collection registered in a single form field. As an example, one should imagine I am creating a Sharepoint database of cat owners and their cats. To store all the all the cat names of one owner in one record, I used the concatenate function as follows:

Concat(
 CatList,
 Cat_Name & "; "
)

This example would have a collection column with several cat names listed as follows:

Cats
Figo; Fluffy; Bob Jr

 

However, now I would like to be able to display these names separately again in a Canvas screen. I assume the Split() function is needed to do so, but I don't know how to execute it. How would I effectively display this data?

 

What I would like it to look like is again something like this:

CatsColorsSex
FigoRedMale
FluffyWhiteFemale
Bob JrBlackMale

 

I would have to know the code which is necessary to retrieve the data from a single selected record in Sharepoint, but also the best field in which to display it. I assume I would have to turn it back into a collection gallery? And how would I most effectively display several of these categories (e.g. the cat's colors, sex, race, etc.), would that be possible within one collection or would it be easier to have a separate collection for each descriptive.

 

I hope someone is able to help me out on this one!

Categories:
  • BCBuizer Profile Picture
    22,854 Super User 2026 Season 2 on at

    Hi @Daniël ,

     

    To turn multiple records into a text (string), you can use the below pattern:

    Concat(
     CatList,
     Cat_Name& "|" & Cat_Color& "|" & Cat_Gender & "; "
    )

     

    In case of the above data sample this will create a string that looks like: 

    Figo|Red|Male; Fluffy|White|Female; Bob Jr|Black|Male; 

     

    To turn this back to a table, the below pattern can be used:

    ForAll(
    	Split(
    		Cat_String,
    		"; "
    	),
    	With({
    		_CatDetails: Split(ThisRecord.Value, "|")
    		},
    		{
    			Cat_Name: Index(_CatDetails,1).Value, 
    			Cat_Color: Index(_CatDetails,2).Value,
    			Cat_Gender: Index(_CatDetails,3).Value
    		}
    	)
    )

     

  • Daniël Profile Picture
    147 on at

    Thank you for your quick reply!

    I still have a few questions:

    How can I make sure this code will only apply to the selected record in my Sharepoint?

     

    Also, could you please clarify a little more on how to implement this to make it look like a table. Do you put it in a text box?

     

    I am thinking _CatDetails would be a new collection that you are creating, but it does not seem to do that for me. What am I missing?

  • BCBuizer Profile Picture
    22,854 Super User 2026 Season 2 on at

    Hi @Daniël ,

     

    How can I make sure this code will only apply to the selected record in my Sharepoint? You can do that by replacing the Cat_String reference in the last formula. 

     

    Also, could you please clarify a little more on how to implement this to make it look like a table. Do you put it in a text box? The formula will return a table, so you need to use a control that can display those, like a gallery or a data table.

     

    I am thinking _CatDetails would be a new collection that you are creating, but it does not seem to do that for me. What am I missing? _CatDetails is just a sort of variable that is used in the context to the With function to not have to perform the Split function for each column. As answered in the first question, it is the Cat_String reference that determines the input of the formula, which should be a single record in your data source. In case you wish to show these tables for multiple records in your datasource, consider using a nested gallery where the formula can be used, with minimal adjustments, for the Items property.  

     

    If you can describe how you want the final screen to look, I can give some more specific answers.

  • Daniël Profile Picture
    147 on at

    Again, thank you for your responsiveness! So currently I have a display form of a selected record within my Sharepoint, which is called Cat_Owners, which has already concatenated the characteristics into strings, as follows:

     

    Name_OwnerAge_Owner
    Jim Brown52
    Owner_SexOwner_Nationality
    MaleCanadian
    Cat_NameCat_Color
    Figo; Fluffy; Bob JrRed; White; Black
    Cat_SexCat_Breed
    Male; Female; MaleSC; MC; Somali

     

    Since I would like the viewers to be able to see more clearly which characteristics relate to which cat, I would like to make them invisible in the display and perhaps show it in a gallery as a table:

     

    NameColorSexBreed
    FigoRedMaleSC
    FluffyWhiteFemaleMC
    Bob JrBlackMaleSomali

     

    I am quite new to using PowerApps, so it's difficult for me to understand which variables relate to what and where certain functions need to be inserted. I do appreciate all your help.

  • BCBuizer Profile Picture
    22,854 Super User 2026 Season 2 on at

    Hi @Daniël,

     

    For your scenario the below could be used for the Items property of the gallery to display the cat details:

     

    With({SelectedItem: Gallery1.Selected},
    	With({
    		_CatNames: Split(SelectedItem.Cat_Name),
    		_CatColor:Split(SelectedItem.Cat_Color),
    		_CatGender: Split(SelectedItem.Cat_Sex),
    		_CatBreed: Split(SelectedItem.Cat_Breed)
    		},
    		ForAll(
    			Sequence(
    				CountRows(
    					_CatNames
    				),
    			),
    			{Name: Index(_CatNames, ThisRecord.Value),
    			Color: Index(_CatColor, ThisRecord.Value),
    			Sex: Index(_CatGender, ThisRecord.Value),
    			Breed: Index(_CatBreed, ThisRecord.Value)
    			}
    		)
    	)
    )

     

    In the above Gallery1.Selected may have to be replaced with a reference to the record to be displayed. I think this should probably be the same as the Form's Item property.

  • Daniël Profile Picture
    147 on at

    Hey, I tried this code in a new Gallery and there are still a few issues.

    With({SelectedItem: Gallery1.Selected},
    	With({
    		_CatNames: Split(SelectedItem.Cat_Name), "; ",
    		_CatColor:Split(SelectedItem.Cat_Color), "; ",
    		_CatGender: Split(SelectedItem.Cat_Sex), "; ",
    		_CatBreed: Split(SelectedItem.Cat_Breed), "; "
    		},
    		ForAll(
    			Sequence(
    				CountRows(
    					_CatNames
    				),
    			),
    			{Name: Index(_CatNames, ThisRecord.Value),
    			Color: Index(_CatColor, ThisRecord.Value),
    			Sex: Index(_CatGender, ThisRecord.Value),
    			Breed: Index(_CatBreed, ThisRecord.Value)
    			}
    		)
    	)
    )

    First I added some separators to the first part of the code (see adjusted code above). Yet, some problems still remain with the Index code and I am not grasping the function well enough to truly understand what is happening or what needs to be solved.

    See the following error(s):

    Danil_1-1683102641875.png

     

    As a solution for now I have just used a Split() function on the datacard of the form:

    Split(DataCardValue, "; ")

    Though this solution requires multiple galleries and may become an issue once I want to make these records amendable.

  • BCBuizer Profile Picture
    22,854 Super User 2026 Season 2 on at

    Hi @Daniël ,

     

    I see I left a comma too much in the formula. Please try:

    With({SelectedItem: Gallery1.Selected},
    	With({
    		_CatNames: Split(SelectedItem.Cat_Name), "; ",
    		_CatColor:Split(SelectedItem.Cat_Color), "; ",
    		_CatGender: Split(SelectedItem.Cat_Sex), "; ",
    		_CatBreed: Split(SelectedItem.Cat_Breed), "; "
    		},
    		ForAll(
    			Sequence(
    				CountRows(
    					_CatNames
    				)
    			),
    			{Name: Index(_CatNames, ThisRecord.Value),
    			Color: Index(_CatColor, ThisRecord.Value),
    			Sex: Index(_CatGender, ThisRecord.Value),
    			Breed: Index(_CatBreed, ThisRecord.Value)
    			}
    		)
    	)
    )

     

     

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

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard