Skip to main content

Notifications

Power Platform Community / Forums / Building Power Apps / Tablist options based ...
Building Power Apps
Answered

Tablist options based on if condition

Posted on by 8
I am trying to set the options of a tablist using different conditions in an IF statement. I want the options to change depending on form mode, and if a variable value is true. My formula below does not work. 
Essentially if the form is new I want the only option to be "Client Details". If it is new and varSeriousIncidentSelected is also true, I want "Client Details" and "Serious Incident".
 
If the form is not new then all the options, but only show "Serious Incident" if varSeriousIncidentSelected is true.
 
Any help is much appreciated.
 
 
 
Categories:
  • Suggested answer
    Nandit Profile Picture
    Nandit 370 on at
    Tablist options based on if condition
    Hi 
     
    Glad that you were able to solve this issue. 
    I have switched a condition in my code and I am just curious to see if it works now. Can you try this:
    If(frmCase.Mode=FormMode.New && varSeriousIncidentSelected = true,
    [{ID:1, Value: "Client Details"}, {ID:3, Value: "Serious Incident"}], If(frmCase.Mode=FormMode.New,
    [{ID:1, Value: "Client Details"}],
    [{ID:1, Value: "Client Details" },
    {ID:2, Value:"LMC Referral"}, {ID:3, Value: "Serious Incident"},
    {ID:4, Value: "PSO Case Notes"}, {ID:5, Value: "Admin"},
    {ID:6, Value: "Case Closure"}]))
    Kind regards,
    Nandit
  • Verified answer
    BF-06081350-0 Profile Picture
    BF-06081350-0 8 on at
    Tablist options based on if condition
    This has been solved using the below formula, incorporating the With function:
     
  • BF-06081350-0 Profile Picture
    BF-06081350-0 8 on at
    Tablist options based on if condition
    Neither of these work unfortunately
  • Suggested answer
    CA1105 Profile Picture
    CA1105 101 on at
    Tablist options based on if condition
    Try this
    If(frmCase.Mode=FormMode.New, [{ID:1, Value: "Client Details"}],
    frmCase.Mode=FormMode.New && varSeriousIncidentSelected,
            [{ID:1, Value: "Client Details"}, {ID:3, Value: "Serious Incident"}],
    [{ID:1, Value: "Client Details" },
    {ID:2, Value:"LMC Referral"}, {ID:3, Value: "Serious Incident"},
    {ID:4, Value: "PSO Case Notes"}, {ID:5, Value: "Admin"},
    {ID:6, Value: "Case Closure"}])
  • Suggested answer
    Nandit Profile Picture
    Nandit 370 on at
    Tablist options based on if condition
     
    You are just missing one IF function in the middle to get it to work. Here's the updated formula:
    If(frmCase.Mode=FormMode.New && varSeriousIncidentSelected = true,
    [{ID:1, Value: "Client Details"}, {ID:3, Value: "Serious Incident"}], If(frmCase.Mode=FormMode.New,
    [{ID:1, Value: "Client Details"}], [{ID:1, Value: "Client Details" }, {ID:2, Value:"LMC Referral"}, {ID:3, Value: "Serious Incident"}, {ID:4, Value: "PSO Case Notes"}, {ID:5, Value: "Admin"}, {ID:6, Value: "Case Closure"}]))
     
    Hope this helps. 
     
    Kind regards, 
    Nandit
     
    If this answers your query, please mark this response as the answer.
    If its helpful, please leave a like. Thanks!
     

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Community Update Sept 16…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 140,745

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,355

Leaderboard