
Hello Everyone,
Good day!
I would like to ask on how I can select 2 values from a collection and display in combo box property default selected items.
my code below as an example:
If(
PrimaryServiceInput.Selected.Title = "Payroll" ||
PrimaryServiceInput.Selected.Title = "Global People Mobility (GPM)" ||
PrimaryServiceInput.Selected.Title = "Equity Administration",
LookUp(
colServices,
Title = "HRIS"
),
LookUp(
colServices,
Title = "HRSS Go To Market (GTM)"
)
)
on the code you can see I used LookUp to display HRIS or HRSS go to market. But what I need is to display 2 values under true condition. on the image below i want to see two values.
Thanks in advance guys!
Hi @YamiteKudasai ,
I understand that you want to use the If-Funktion to return two items (HRIS, HRSS) from your collection (colServices). These two items (titles) shall be displayed as default selected items in your combo box.
You would have to change your if-fuction to get this result.
The if-funktion does have 3 arguments (Condition, True-Result, False-Result).
Your function does return "HRIS", when your condition is true and "HRSS" when it is not true.
To have both values displayed you would have to put those two values in the (True-Result).
I rebuilt your example:
If(
varTest = true,
LookUp(
colServices,
Title = "HRES"
),
LookUp(
colServices,
Title = "HRSS Go To Market (GTM)"
)
)With the following formula
If(
varTest = true,
Filter(
colServices,
Title = "HRES" || Title = "HRSS Go To Market (GTM)"
)
)you get
You need to use the "filter" function, als "lookup" does only return one result (the first match).
Also make sure you have set "allow multi select" to true for the combo box.
Regards,
David