cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

Split/Extract names from a delimiter string in PowerApps

Hello,

 

I've got a string "Jack, Jim, Tom" where I need to return all three names without the delimiter (", "). I've done the following but I only get the first and the last name.

 

[First(FirstN(Split("Jack, Jim, Tom", ", "), 1)).Result, Last(LastN(Split("Jack, Jim, Tom", ", "), 1)).Result]

 

 

Is it possible to get the name in the middle (Jim) as well?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Split/Extract names from a delimiter string in PowerApps

Hi @Kevin_Maxwell

 

Unless I misunderstand you, I think the issue here is that the Split function returns a single column table and the name of this column is "Result". This column name doesn't match the field name that you're displaying in your ComboBox, and this is the reason why it shows up blank.

 

In this instance, you can call the RenameColumns function to rename the Result column to the required field name. Here's an example of how to rename the column Result to Value.

 

Split2.PNG

 

 

View solution in original post

9 REPLIES 9
Highlighted
Super User
Super User

Re: Split/Extract names from a delimiter string in PowerApps

Hi @Kevin_Maxwell

 

The Split function on its own will extract your names into 3 rows in a single column table. You can use the result to populate data controls such as gallery controls, data tables, listboxes etc.

 

Split.PNG

 

Does this help?

Highlighted
Advocate I
Advocate I

Re: Split/Extract names from a delimiter string in PowerApps

Hi @timl,

 

Thank you. I'm aware of the Split function. However, I'm using this function on Combo Box DefaultSelectedItems. The usual Split function doesn't display my items (it's blank) but when I use the posted function or even Left,Mid,Right function I can make them work partially.

Please see the attached image which it demonstrates my current situation.

 

Capture.JPG

Highlighted
Super User
Super User

Re: Split/Extract names from a delimiter string in PowerApps

Hi @Kevin_Maxwell

 

Unless I misunderstand you, I think the issue here is that the Split function returns a single column table and the name of this column is "Result". This column name doesn't match the field name that you're displaying in your ComboBox, and this is the reason why it shows up blank.

 

In this instance, you can call the RenameColumns function to rename the Result column to the required field name. Here's an example of how to rename the column Result to Value.

 

Split2.PNG

 

 

View solution in original post

Highlighted
Advocate I
Advocate I

Re: Split/Extract names from a delimiter string in PowerApps

THANK YOU SO MUCH @timl FOR YOUR PROMPT SUPPORT!!!

It works as expected.

Highlighted
Super User
Super User

Re: Split/Extract names from a delimiter string in PowerApps

You're welcome! I'm it works.

Highlighted
Responsive Resident
Responsive Resident

Re: Split/Extract names from a delimiter string in PowerApps

Thanks, I was also looking to split the data back into the combo box in selected items.

 

I'm loading data from a CDS database into an edit page and needed to split the items back individually to allow removing or adding them without bugs.

Highlighted
Regular Visitor

Re: Split/Extract names from a delimiter string in PowerApps

THANK YOU SO MUCH! I'VE BEEN LOOKING FOR THIS FOR TWO DAYS. IT HELPED ME A LOT.




Highlighted
Super User
Super User

Re: Split/Extract names from a delimiter string in PowerApps

I'm very pleased that this helped you @Rogodoy! Good luck!

Highlighted
Microsoft
Microsoft

Re: Split/Extract names from a delimiter string in PowerApps

Thank you for this solution @Tim ! I had the same issue returning values from SQL to repopulate my combobox. 

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (3,648)