cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Power Automate
Power Automate

List Box to String

Is it possible to take the collection called arrayName (now shown in a multi-select list box control in PowerApps) and convert it to a string of text where semi-colons separate the array items?

 

It had a collect(numbers)

which is now

1

2

3

4

 

I want to convert it to 1;2;3;4

 

Please help.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Advocate III
Advocate III

Re: List Box to String

Hi,

 

        Try with below sample If you want to get "1;2;3;4" from your collection or list box.

 

Try below code inside TextBox's Text Property

Left(Concat(ListBox1.SelectedItems.Value, Concatenate(Text(Value), ";")),Len(Concat(ListBox1.SelectedItems.Value, Concatenate(Text(Value), ";"))) - 1)

Regards,

View solution in original post

5 REPLIES 5
Highlighted
Advocate III
Advocate III

Re: List Box to String

Hi,

 

        Try with below sample If you want to get "1;2;3;4" from your collection or list box.

 

Try below code inside TextBox's Text Property

Left(Concat(ListBox1.SelectedItems.Value, Concatenate(Text(Value), ";")),Len(Concat(ListBox1.SelectedItems.Value, Concatenate(Text(Value), ";"))) - 1)

Regards,

View solution in original post

Highlighted
Power Automate
Power Automate

Re: List Box to String

Left(Concat(BrowseProducts.Selected.Title, Concatenate(Text(Value), ";")),Len(Concat(BrowseProducts.Selected.Title, Concatenate(Text(Value), ";"))) - 1)When I enter that (which made total sense to me), and then I ran the app and selected items in that ListBox it didn't do anything at all. What I realized is that I need to actually touch the listbox to get that to work. (So it works on selection.) GREAT SOLUTION.....only it wasn't working for my scenario....which I didn't explain to you - LOL.

 

So I have a gallery on the left side of the page, when I select an item from the gallery it goes into the list box, as a result of that I want the text box to be populated. So I thought I would be able to add your expression to the onchange event of the list like this:

TextBox3.Text = Left(Concat(ListBox2.SelectedItems.Value, Concatenate(Text(Value), ";")),Len(Concat(ListBox2.SelectedItems.Value, Concatenate(Text(Value), ";"))) - 1)

 

But it didn't work (as I have learned that I can't really set a field based on another field). Do you have any ideas for how I can get around this nuance?

 

FYI: I also tried skipping over the ListBox and going directly from the Gallery to the text box with this modification (but it doesn't work):

Left(Concat(BrowseProducts.Selected.Title, Concatenate(Text(Value), ";")),Len(Concat(BrowseProducts.Selected.Title, Concatenate(Text(Value), ";"))) - 1)

Highlighted
Frequent Visitor

Re: List Box to String

What do you mean by Text(Value) please ?

Highlighted
Regular Visitor

Re: List Box to String

Thanks so much!  I'm new to PowerApps and this resolved the issue I was struggling with!

Highlighted
New Member

Re: List Box to String


@audrieg wrote:

So I have a gallery on the left side of the page, when I select an item from the gallery it goes into the list box, as a result of that I want the text box to be populated. So I thought I would be able to add your expression to the onchange event of the list like this:

TextBox3.Text = Left(Concat(ListBox2.SelectedItems.Value, Concatenate(Text(Value), ";")),Len(Concat(ListBox2.SelectedItems.Value, Concatenate(Text(Value), ";"))) - 1)

 

But it didn't work (as I have learned that I can't really set a field based on another field). Do you have any ideas for how I can get around this nuance?



You'll probably want to enter the formula as the default in the text box and reset the textbox onchange of the listbox.

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

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

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,047)