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

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
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,496)