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 COLUMN
USER CONTROL
Solved! Go to Solution.
OR(
CONTEXT(โViewTypeโ) = โFormโ,
SWITCH(
INDEX(
SELECT(
User Login[User Control],
[Email]=useremail()
)
,1),
"User",FALSE,
"Admin",TRUE,
FALSE
)
)
OR(
CONTEXT(โViewTypeโ) = โFormโ,
SWITCH(
)
)
@Joseph_Seddik can you explain this function.
i think you can use the function like that:
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
)
)
User | Count |
---|---|
15 | |
14 | |
8 | |
7 | |
4 |