Index record type with condition

How to index department from one of the index where empId is same as loggedin user Id.

here allUsers stores Record data.

  Discussion posts and replies are publicly visible

  • +1
    Certified Associate Developer

    you can query the data based on loggedin user details from which you can find logged in user id and then
    find the indexes where these id exists , and extract the department from the indexes
    take reference from this code

      index(local!allUsers[recordType!yourRecord.field.department],wherecontains(local!loggedInUserId,local!allUsers[recordType!yourRecord.field.empid]),{})