What is the most efficient between IF and showWhen=False ?

Certified Senior Developer

Hi,

My question is maybe a little naive but for increasing performance I was asking myself if use the showWhen attribute on 10 components is as good using an IF condition to masking all these components.

I took 3 examples :

1/ Case showWhen on all components :

ColumnsLayout(
    columnLayout
        TextField_1label: "1", showWhen: false)
    columnLayout(
        TextField_2(label: "2", showWhen: false)

    ...

    columnLayout(
         TextField_10(label: "10", showWhen: false)
)

2/ Case showWhen on layout component :

ColumnsLayout(
    columnLayout
        TextField_1(label: "1")

    columnLayout(
        TextField_2(label: "2")
    ...

    columnLayout(
        TextField_10(label: "10")
    ),
    showWhen : false
)

3/ Case with an IF condition :

local!value: false,
if(local!value,
   ColumnsLayout(
      columnLayout
          TextField_1(label: "1")

      columnLayout(
          TextField_2(label: "2")
      ...

      columnLayout(
          TextField_10(label: "10")
     )
  ),
  {}
)

Is the 3/ more efficient as Appian do not need to load anything ?  

  Discussion posts and replies are publicly visible