cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
prasadvenkat
Helper I
Helper I

How do I get the selected Item Text in ListBox

I have a single selection listbox. How do I get the text of the selected Item? Trying SelectedItems.Result, SelectedItemText etc. Nothing seems to work . Any ideas? Thx

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@prasadvenkat 

It really depends on if you have "Allow multiple selections" on.

If NOT, then you can use:

   First(ListBox.SelectedItems).Value

 

If so, then you can use:

   Concat(ListBox.SelectedItems, Value & ",")
Or...if you need this formatted with something like comas, then this will do well:

   Mid(3, Concat(ListBox.SelectedItems, ", " & Value), 3)

 

Obviously, replace ListBox in the above formulas to the name of your listbox.

I hope this is helpful for you.

 

EDIT: Just re-read your question "single selection listbox"...so, the first solution should be fine for you and you can keep the other in your back pocket for a day when you need multiple selections.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi,

 

Test this : DataCardValueX.Selected.Value, where DataCardValueX is the number of your datacard.

RandyHayes
Super User
Super User

@prasadvenkat 

It really depends on if you have "Allow multiple selections" on.

If NOT, then you can use:

   First(ListBox.SelectedItems).Value

 

If so, then you can use:

   Concat(ListBox.SelectedItems, Value & ",")
Or...if you need this formatted with something like comas, then this will do well:

   Mid(3, Concat(ListBox.SelectedItems, ", " & Value), 3)

 

Obviously, replace ListBox in the above formulas to the name of your listbox.

I hope this is helpful for you.

 

EDIT: Just re-read your question "single selection listbox"...so, the first solution should be fine for you and you can keep the other in your back pocket for a day when you need multiple selections.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Its a single selection listbox. Your suggestion to use: First(listbox.selecteditems).value worked for me. Thanks for the response

Hi RandyHayes,

 

Have tried this, but it says concat takes only tables as input. Please let me know if there is a way around.

 

Thanks in advance!

@kavya__ 

What issue are you having?  The ListBox.SelectedItems is a table.  Please re-check your formula and make sure you are using that and referencing the listbox as that.

If you continue to run into issues, I might suggest that you open a new post on the forum so that this will get more attention for you as this thread is pretty old.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Thanks for replying. ListBox.SelectedItemsValues worked!

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,731)