Hi All,
I have a requirement to display the selectable Task Grid based on some conditions. Please find the below details
I have a DB table A and Table B
Table A:
Note:
- If the user is having a null value in the region field then that user will be Considered as Glob (Global User) if its not null then the type should be Rlob (Regional User).
- User field should be unique.
Table B:
I'm having the following local variables which initialized with rule!myTaskGrid and rule!AllTaskGrid,
1)local!myTaskGrid - which will display the logged In user assigned/Accepted tasks
2)local!AllTaskGrid - which will display all the assigned/accepted tasks (tasks assigned to the logged in user and not assigned tasks also).
My requirement is,
If the logged In user is not in the table A then that user should be considered as a Basic user and able to view only the tasks which are assigned/Accepted to him.
If the logged In user is in the Table A then we need to find whether that user is Glob or Rlob,
Glob:
if the logged In user is of Glob (region of user is null) then it should display all the local!AllTaskGrid by taking parameters logged In user, lob.
RLob:
if the logged In user is of Rlob (region of user is not null) then it should display all the local!AllTaskGrid by taking parameters logged In user, lob and region.
Could you please help me in transforming in to SAIL Code.
Thanks in Advance,
Discussion posts and replies are publicly visible
Hi,did you create some data stores and cdts?
Yes, all the entire set up was done including creating Expression rules for those CDT’s. I just need aa..If condition logic
i struggle a bit about "user in tables" logic in connection with status and permissions of users.For user rights we use usually administration or group memberships? any deeper reasons why not using it?did you create a cdt for each table, so there is a CDT "A" and a CDT "B"? (sorry for the many questions, i try just to understand the requirements and your current implementation)
The user names in the Table A are static data. we will add the users in that table manually based on user requirement(whether the user is a basic or Glob or Rlob).
yes, I have created each CDT for table A and table B.
My requirement is straight forward only.
I would recommend creating a expression rule, which is searching for the username in the table.this rule will check for loggedInUser(). in this rule you can use queryEntity() to parse in Table A and search for his name on column "user". https://docs.appian.com/suite/help/20.3/fnc_system_a_queryentity.htmlThe output will be a datasubset. save it into a local. (local!datasubset)depending on totalCount=0, there is no user with this name in table A.if you got a hit, then cast the local!datasubset.data, into to the suitable CDT and check for cdt.region.create suitable If clauses like
if( isnull(cdtA.region) ="Glob", "Rlob" )