cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
prasadvenkat
Level: Powered On

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
Super User
Super User

Re: How do I get the selected Item Text in ListBox

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

3 REPLIES 3
Nosmoz
Level: Powered On

Re: How do I get the selected Item Text in ListBox

Hi,

 

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

Super User
Super User

Re: How do I get the selected Item Text in ListBox

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

prasadvenkat
Level: Powered On

Re: How do I get the selected Item Text in ListBox

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

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 83 members 3,383 guests
Please welcome our newest community members: