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

AutoPopulate Text Field from Collection based on Combo box Selection

I am creating a power app to process our inventory and customer orders.

 

My SharePoint list for products far exceeds what PowerApps will call, so I created a collection called AllProducts that runs upon launch.

 

Dropdown input fields don't return enough results, so I need to use a combo box (multiselect is disabled). The combo box is used on the product name and I need the SKU and UOM to autopopulate in the form from the collection. 

 

I've tried to use variables and a collection to get the respective data, but I'm not getting the right syntax. What do I use to set the default property for those fields?

 

PowerApp Combobox.PNG

 

PowerApp Combobox 2.PNG

 

8 REPLIES 8
Drrickryp
Super User II
Super User II

Hi @crystalhowat 

Set the Default of your textinput controls to Combobox1.Selected.SKU or Combobox1.Selected.OUM 

gabibalaban
Super User II
Super User II

Hi @crystalhowat ,

 

From your screenshot, SKU seems to be a TextInput control. To set the default property of this control based on ProductName combobox selected item you can use:

LookUp(YourCollection,  ProductName=ProductNameComboBox.Selected.ProductName,SKU)

 

For UOM, which seems to be a comboBox control, I need to see the Items property to tell you what to do. 

 

Hi @gabibalaban 

A combobox selects an entire record.  All of the fields in that record should available simply by referencing it. 

Yes, I missed that part that the data came from the same collection. I still have my doubts about UOM, I don't know why but I think that is a choice / lookup column in sharepoint and the data came as records. Hope I'm wrong ! 

That was my default go to and it wouldn't reference any data. 

I think I changed the field of UOM to a combo box just to see if that would change it. It is a record and it doesn't like the LookUp formula that did work for SKU. That was a text record. Any ideas how to get that one to work?PowerApp Combobox 3.PNG

 

crystalhowat
Frequent Visitor

Okay, I'm silly and I figured out that I just needed to reference the UOM as UOM.Value and the error went away.

 

But, once I make a change to that combo box, nothing appears. It only references the first item in the collection. I appear to be stuck once again. Please help!!!

 

I am not adverse to setting up a video conference if anyone out there is interested in helping me figure this out. I'm normally very good at tinkering until I get it to work.

PowerApp Combobox 4.PNG

 

I tried putting the lookup for the SKU in the OnChange and OnSelect properties as a variable setting and it worked and the UOM also updated even though I didn't make any changes there. But it only worked once and then I don't know what happened (facepalm).........

PowerApp Combobox 5.PNG

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (32,873)