I would really like the PowerApps team to implement a better approach for setting de DefaultSelectedItems on a combobox. Idea is to add a new formula option or an .AllItems property for this control.
Current process:
For items I use a formula like:
SortByColumns( ShowColumns( Filter(_Materials ,If(_TestMode, true, !(ID = 32)) ) ,"MaterialFullName","ID" ) ,"MaterialFullName" ,Ascending )
To select a DefaultSelectedItems I have to use the same formula surrounded by a LookUp() or Filter() forluma like
LookUp( SortByColumns( ShowColumns( Filter(_Materials ,If(_TestMode, true, !(ID = 32)) ) ,"MaterialFullName","ID" ) ,"MaterialFullName" ,Ascending ) ,ID = _RLSelected.MaterialID )
Suggested Approach:
LookUp(MyDropBox.AllItems,ID = _RLSelected.MaterialID) // referencing the control it self LookUp(Me.AllItems,ID = _RLSelected.MaterialID) // referencing the control it self by a parentname (Me, ThisControl) Filter(Me.AllItems, ID in [1,3,7,8]) // same as above but for multiple items
@Audrie-MSFT, hope the team can help with this. Would take a lot off coding out and reduces the errors on changes.
Paul