Combo box 1
Combo box 2
Item property of combo box 1 - Distinct(Equipments_List, alpha_)
Item property of combo box 2 - Distinct(Filter(Fruits_List, alpha_ = ComboBox1.Selected.Result), name)
I have been able to make the first combobox depend on the second combobox. I’m not able to make the second combobox depend on the first combobox.
Hi @sahilauzim ,
Can you try to refer the solutions from this post?
And see if through this post could solve your problems. If yes, please Accept as Solution.
Instead of putting the Distinct Filter functions in Items properties, can you copy and paste the same code to DefaultSelectedItems properties?
You can remove the code for OnChange properties.
As combobox need Default selected items property to read for default selected.
Hope it helps.
I have use another example.
I have paste the same code on DefaultSelectedItems. The unit number is working good. That is, it is dependent on the serial number.
The code I have used.
But I'm not able to make the Serial Number to be dependent on the Unit Number.
Click your Serial Number combobox and see at its depends on..
Is it depends on to Unit Number combobox? If it is not, you can set it.
Is it solved?
The trick to avoiding a circular reference with interdependent comboboxes is to use a collection of the selected items from each combobox using the combobox's OnChange property: ClearCollect(colserial,Self.SelectedItems) for combobox1 and ClearCollect(colunit,Self.SelectedItems) for combobox2. Then set the Items properties of each combobox as follows:
For the Items property of Combobox1:
Sort( Distinct( Filter( Equipments_List, SerialNumber in colserial|| IsEmpty(colserial) ), 'Unit Number' ), Result )
and for the Items property of Combobox2:
Sort( Distinct( Filter( Equipments_List, UnitNumber in colunit || IsEmpty(colunit) ), SerialNumber ), Result )
You may need to correct the column names but hopefully you get the idea.
It is still not good.
In my case, the 'unit number' is title as I have to use a unique column. I have rename the column name
(1) For the serial number on Items' property
(2) For the unit number (which is title in my case) on Items' property
I assume you have done the clearcollect for each combobox?
ClearCollect(colserial,Self.SelectedItems) for combobox1 and ClearCollect(colunit,Self.SelectedItems) for combobox2
What is the error for colunit ya? And can you add bracket after Result, as you missed the end bracket.
Keep up to date with current events and community announcements in the Power Apps community.
A great place where you can stay up to date with community calls and interact with the speakers.
Check out the latest Community Blog from the community!