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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

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.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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