This is my code. Basically I have 3 more dropdowns that the choices for the office location is going to be based on the other 3 selected value but I want to add Any - no preferred location to my office location drop down.
this is the code that is not working.
ClearCollect(
OfficeLocationCollection,
Distinct(
Filter(
'DataSource',
ONE= DataCardValueONE.Selected.Value &&
TWO= DataCardValueTWO.Selected.Value &&
THREE= DataCardValueTHREE.Selected.Value
),
'Office Location'
)
);
Collect(
OfficeLocationCollection,
{ OfficeLocationLabel: "Any - No preferred location" }
);
it looks like this for my new formula. Its blank
this has worked perfectly in a combobox. I initially was using a drop down that's why it did not work. Thanks @WarrenBelz
@kej ,
Yep - does not work in drop-down (I had never tried that before). I assume you are in Oz ?
oh im using a dropdown on this one not a combobox. will try to use a combo box with the same formula
@kej ,
This is not making a lot of sense to me presently as I use this structure regularly in prod apps. Assuming this is a classic Combo Box, are you displaying the Value field ?
hello yes this is the current values of dropdown with that formula used
@kej ,
It will work if your posted code is valid - does this return a list ?
Distinct(
Filter(
'DataSource',
One = DataCardValueOne.Selected.Value &&
Two = DataCardValueTwo.Selected.Value &&
Three = DataCardValueThree.Selected.Value
),
'Office Location'
)
did not work as intended other values are appearing as blanks.
Hi @kej ,
You do not need the Collection - put this in the Items of your drop-down
Ungroup(
Table(
{Data: Table({Value: "Any - No Preferred Location"})},
{
Data:
Distinct(
Filter(
'DataSource',
One = DataCardValueOne.Selected.Value &&
Two = DataCardValueTwo.Selected.Value &&
Three = DataCardValueThree.Selected.Value
),
'Office Location'
)
}
),
"Data"
)
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.
MVP (Business Applications) Visit my blog Practical Power Apps
WarrenBelz
146,660
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional