cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rvdhorst
Helper II
Helper II

Switch Function

I would like to use the Switch function instead of the If function.
The fill must be filled if a color matches. I thought something like that.

 

If(LookUp(col_PlannerkeukenCombi,CombiID=ThisItem.CombiID,Switch(ThisItem.CombiID,Color,"Rood",Red,"Blue",blue)))

 

If that works is like this:

If(LookUp(col_PlannerkeukenCombi,CombiID=ThisItem.CombiID,Kleur="Rood"),Red,
If(LookUp(col_PlannerkeukenCombi,CombiID=ThisItem.CombiID,Kleur="Geel"),Yellow, White
))

 

Thanx

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @rvdhorst ,

 

Maybe you could try:

Switch(
  LookUp(col_PlannerkeukenCombi,CombiID=ThisItem.CombiID).Kleur,
  "Rood",
  Red,
  "Geel",
  Yellow,
  White
)

 

Best Regards,

Bof

View solution in original post

Hi @rvdhorst :
You could try:

Switch(
  LookUp(
    col_PlannerkeukenCombi,
    CombiID=LookUp(
              Filter(
                 'Keuken Cycles',
                  Status='Status (Keuken Cycles)'.Actief
             ),Datum=Cyclus_DatePicker_Begin_1.SelectedDate).CombiID
    ).Kleur,
   "Rood",
    Red,
    "Geel",
    Yellow,
    Black
)

Best Regards,

Bof

View solution in original post

6 REPLIES 6
ASHetap
Resolver I
Resolver I

I had the same issue that you had but i also could not find anything regarding a switch function so i had to do with if statements sadly.

rho1967
Helper III
Helper III

I was already afraid of that.

Thanks for the reply
v-bofeng-msft
Community Support
Community Support

Hi @rvdhorst ,

 

Maybe you could try:

Switch(
  LookUp(col_PlannerkeukenCombi,CombiID=ThisItem.CombiID).Kleur,
  "Rood",
  Red,
  "Geel",
  Yellow,
  White
)

 

Best Regards,

Bof

Great,

That works. 

 

I have also this one. Can it also be done with Switch?
If(LookUp(col_PlannerkeukenCombi,CombiID=LookUp(Filter('Keuken Cycles',Status='Status (Keuken Cycles)'.Actief),Datum=Cyclus_DatePicker_Begin_1.SelectedDate,CombiID),Kleur="Rood"),Red,

If(LookUp(col_PlannerkeukenCombi,CombiID=LookUp(Filter('Keuken Cycles',Status='Status (Keuken Cycles)'.Actief),Datum=Cyclus_DatePicker_Begin_1.SelectedDate,CombiID),Kleur="Geel"),Yellow, Black
))

Hi @rvdhorst :
You could try:

Switch(
  LookUp(
    col_PlannerkeukenCombi,
    CombiID=LookUp(
              Filter(
                 'Keuken Cycles',
                  Status='Status (Keuken Cycles)'.Actief
             ),Datum=Cyclus_DatePicker_Begin_1.SelectedDate).CombiID
    ).Kleur,
   "Rood",
    Red,
    "Geel",
    Yellow,
    Black
)

Best Regards,

Bof

rvdhorst
Helper II
Helper II

Thanx all,

 

 

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,621)