Skip to main content
November 24, 2022
Solved

Index record type with condition

  • November 24, 2022
  • 1 reply
  • 0 views

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

here allUsers stores Record data.

    Best answer by amans0009

    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]),{})
      

    1 reply

    amans0009
    amans0009Answer
    November 24, 2022

    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]),{})