Defining Case Visibility for loggedinuser()

Certified Senior Developer

We have a requirement to see the cases on dashboard based on some criteria.  This criteria is defined in a table called user access details. Details of all the cases are present in one record.

How can we apply these user access details values as filters inside another record to get the values??

Note: For a single user, there can be multiple user access details, so there will be multiple rows. Each row need to be applied as filter to the record.

Screenshots have been added for reference. First image refers to user access details, second one refers to data table

When User A logs into Appian, they should see only caseid 1001, when user B logs in they should see only case 1003. How can we achieve this using Records??

We already tried using record level security, but here we can define only static values. But, in our scenario we need to define dynamic values which will be varied on logged in user.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    On the interface, based on the logged-in user, pull data from the User Access Details table. Store this data in a local variable.
    Loop through each row in the local variable and query the Cases data table for each row using queryFilter on product and platform. You might get multiple entries. Flattening the output using flatten().
    You can display these entries as desired.

    Added sample code for your understanding
    Let me know if that works for you.

    a!localVariables(
      local!userAccessDetails: /*Pull data from user access detail here(Multiple Entries for loggedIn User)*/
    a!flatten(  a!forEach(
        items: local!userAccessDetails,
        expression: a!queryRecordType(
          recordType: {},
          filters: {
            a!queryFilter(
              field: "product",
              operator: "=",
              value: index(local!userAccessDetails, "product", {})
            ),
            a!queryFilter(
              field: "platform",
              operator: "=",
              value: index(local!userAccessDetails, "platform", {})
            )
          },
          
        )
      )
      )
    )

  • 0
    Certified Senior Developer
    in reply to Shubham Aware

       We already tried this approach, but record is not accepting rule! functions

Reply Children