Hide from the details view and show the column inside the form.

I want to show the [AWB NO] column inside the form. But in the details view, I have to show only the specific user's.

This function is working. But the details and form hide from both the places. 

SWITCH(
  INDEX(
     SELECT(
       User Login[User Control],
       [Email]=useremail()
            )
        ,1),
  "User",FALSE,
  "Admin",TRUE,
  FALSE
)

AWB COLUMNAWB COLUMNUSER CONTROLUSER CONTROL

 

Solved Solved
0 8 139
1 ACCEPTED SOLUTION

OR(
   CONTEXT(โ€œViewTypeโ€) = โ€œFormโ€,

SWITCH(

  INDEX(

     SELECT(

       User Login[User Control],

       [Email]=useremail()

            )

        ,1),

  "User",FALSE,

  "Admin",TRUE,

  FALSE

)

)

View solution in original post

8 REPLIES 8

OR(
   CONTEXT(โ€œViewTypeโ€) = โ€œFormโ€,
   SWITCH(

   )
)

@Joseph_Seddik  can you explain this function. 

i think you can use the function like that:

SWITCH(
    any(
     SELECT(
       User Login[User Control],
       [Email]=useremail()
            )
  )="User",FALSE,
  any(
     SELECT(
       User Login[User Control],
       [Email]=useremail()
            )
  )="Admin",TRUE,
  FALSE
)

ERROR

 

SWITCH(
    any(
     SELECT(
       User Login[User Control],
       [Email]=useremail()
            )
  )="User",FALSE,
  any(
     SELECT(
       User Login[User Control],
       [Email]=useremail()
            )
  )="Admin",TRUE,
  FALSE
)

SWITCH function is used incorrectly: Inputs to SWITCH() must be an initial expression, one or more value-result pairs, and a default result

The Show? field requires an expression that will either return True of False. 

We use an OR() expression, that has two statements. If either statement returns True, OR() will return True. 

The first OR() statement is an expression using CONTEXT() function. It will return True if the view shown to the user is a Form view. So your column will always show in a Form view. 

Otherwise, if the view is not a Form, then the second OR() statement is evaluated. This second statement is your original SWITCH() expression, where you test whether the user is Admin, and in this case the column will be shown to the user.

Donโ€™t use an empty switch. copy/paste your existing switch there. 

OR(
   CONTEXT(โ€œViewTypeโ€) = โ€œFormโ€,

SWITCH(

  INDEX(

     SELECT(

       User Login[User Control],

       [Email]=useremail()

            )

        ,1),

  "User",FALSE,

  "Admin",TRUE,

  FALSE

)

)

Top Labels in this Space