Hi,
I'm struggling to get my default value of my Combo box (LocationComboBox) to load based on the selected value of another Combo box (CustComboBox). This is the setup:
The LocationComboBox shows a list of all place names (LocationName) from LocationList (single-selection only as well). I would like it's default value to be the LocationName stored in LocationList, based on the matching assigned site code of the CustRef selected in CustComboBox.
So far I have (for LocationComboBox's default):
LookUp(LocationList,LocationCode=CustComboBox.Selected.AssignedLocationCode,LocationName)
It works in a text input field, but not sure how to make it work for a Combo box field.
Any help appreciated, thanks!
Solved! Go to Solution.
Hi @rhiheu :
Do you want to set the LocationComboBox's default options based on the selection in CustComboBox?
Do you want to display the options in LocationComboBox's as LocationName?
The point is the combo box’s DefaultSelectedItems property.
I’ve made a test for your reference:
Set the LocationComboBox's property to:
Items:
LocationList
DefaultSelectedItems:
LookUp(LocationList,LocationCode=CustComboBox.Selected.AssignedLocationCode)
DisplayFields: ["LocationName"]
SearchFields:
["LocationName"]
I think this link will help you a lot:
Combo box control in Power Apps
Best Regards,
Bof
Hi @rhiheu :
Do you want to set the LocationComboBox's default options based on the selection in CustComboBox?
Do you want to display the options in LocationComboBox's as LocationName?
The point is the combo box’s DefaultSelectedItems property.
I’ve made a test for your reference:
Set the LocationComboBox's property to:
Items:
LocationList
DefaultSelectedItems:
LookUp(LocationList,LocationCode=CustComboBox.Selected.AssignedLocationCode)
DisplayFields: ["LocationName"]
SearchFields:
["LocationName"]
I think this link will help you a lot:
Combo box control in Power Apps
Best Regards,
Bof
Hi Bof,
I assumed with the 'DisplayFields' part you meant enter that under the separate DisplayFields property, not under DefaultSelectedItems, then it worked perfectly, thanks!!
Thanks for the Combo box control in Power Apps link too. I had made the assumption that 'Default' was for single-selection only Combo boxes and 'DefaultSelectedItems' was for multi-selection Combo boxes. Do you know what is the purpose of the 'Default' field for Combo boxes? Just for my future reference. I've tried googling for an answer to this to no avail.