I want to select only the documents that fulfill the following conditions (I put the statement into "View Selection" of the view's property). What I want to achieve is the following logic:
If user has [roleA]
SELECT(formA & status=1)
if user has [roleB]
SELECT(formA & status = 2)
if user has [roleB]
SELECT(formA & status = 3)
Instead SELECT gets appened to the front and the statement does not work or does not give back the desired results.I have tried the following statement:
SELECT @If(@IsMember("[roleA]"; @UserRoles);
(form = "formA" & status="1"); 1=1)
this does not provide wanted results. All is hosted on a server.
You can't use user specific functions in view select. The selection is done on server by server with server's credentials.
Create three views instead - for each role a separate. Link then user to "their" view depending on @UserRoles in an outline e.g.
Another way is using an embedded view in a Page like suggested in your last question. This time first categorized column would be status
and "Show single category" would have formula
@If(@IsMember("[roleA]"; @UserRoles); "1"; @IsMember("[roleB]"; @UserRoles); "2"; "3")