cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
hughrmarks
Helper IV
Helper IV

Set variable to item selected in List Box

Can understand why this doesn't work.  

 

I have a list box named "Players".   I select one of the players from the list and click button "1", which should set the player's name as Variable1 so I can put it in a specific text box.   The formula I used for button 1 to create the variable was:

OnSelect = set(Variable1, Players.SelectedItems)

 

I didn't get an error message with that formula but when I set my text box to:

Text = Variable1

I get the error message:  The property expects text values, but this rule produces incompatible Table values.

 

I don't get it.

 

 

14 REPLIES 14

Well I'm not sure what I messed up on the original but I reproduced from scratch on a test page and it works perfectly.   Thanks so much for your help!  

 

Is there a simple way (or a Community page you can direct me to) where I can learn to now remove that selected item from the "Players" collection so it cannot be selected again?

 

Again - thanks for solving this!

Mike8
Memorable Member
Memorable Member

Hello,

Glad I could help.

When you edit an app top right corner there is a question mark. (?)
Press it and select Documentation.
https://docs.microsoft.com/en-us/powerapps/
In the search bar, type remove and click enter 🙂

You can use the remove function, in order to remove a record from the collection "Players".

Perfect.   Thank you again.

I hope you all know how important this interaction is to those of us who are just starting out.  

 

Mike8
Memorable Member
Memorable Member

Of course hughrmarks.
Please let me know if you need anything else. 🙂
You can also check this:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/formula-reference

Anonymous
Not applicable

I agree, often I find that creating a simple app to handle the issue works really good as proof of concept.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (3,324)