cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JoeG1
Frequent Visitor

Setting Items property 'Value' programmatically.

Using Sharepoint list name 'Fruit'

Col1AppleOrangePeach
AppleredbloodGA
Orangegreensweetwhite
Peachyellowsourgold

 

Powerapps with listboxes.

Listbox1 uses 'Col1' for the data.  --> this is no problem.

Listbox2 needs to use the data in the column that is selected in Listbox1.  For example, if 'Orange' is selected in Listbox1, then Listbox2 should display the data in the 'Orange' column (i.e. blood, sweet, sour).  Basically, programmatically setting the 'Value' field of Listbox2 to the selected value of Listbox1. 

If Listbox1 = 'Peach', then Listbox2 available selections are GA, white, gold.

If Listbox1 = 'Apple', then Listbox2 selections are red, green, yellow.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @JoeG1 

The listboxes and the formulae for the Items in each box is shown beneath the listbox. 

listboxes.png

View solution in original post

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @JoeG1 ,

You cannot dynamically refer to a field name in Power apps.

So you would need something like this (I also assume col1 has a name)

Switch(
   YourDropdownName.Selected.col1Name,
   "Apple",
   YourListName.Apple,
   "Orange",
   YourListName.Orange,
   "Peach",
   YourListName.Peach
)
   

This may not work properly as dynamic Items of drop-downs are also problematic.

If this happens, you will need a collection and I will assist with this if necessary.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Hi @JoeG1 

The listboxes and the formulae for the Items in each box is shown beneath the listbox. 

listboxes.png

View solution in original post

JoeG1
Frequent Visitor

Thought that was away.  haven't programming in a while and powerapps is new to me.

 

thanks

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Top Solution Authors
Top Kudoed Authors
Users online (1,603)