I am trying to display 2 fields in a record picker.

Certified Associate Developer

I have a functioning record picker that searches a first name field, but would also like it to display a second field, a last name filed.  Any thoughts?

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to AllenP

    After some further thought, it occurred to me that the above code snippet will tend to mix up the ordering of selected users in your list (assuming you're planning to allow picking of more than 1; otherwise disregard this).  To fix that, you can swap out the a!forEach logic there with the following... it does query slightly less efficiently, but shouldn't make a big difference overall, while preserving the ordering of the users selected.

    a!forEach(
      ri!userIdList,
      a!localVariables(
        local!userCdt: rule!queryEntity_Users(
          personIds: fv!item,
          columns: {"firstName", "lastName", "username", "userId", "isActive"}
        ).data,
        
        local!userCdt.firstName & " " & local!userCdt.lastName & " (" & local!userCdt.username & ") [" & local!userCdt.personId & "]" & if(local!userCdt.isActive, "", " (Deactivated)")
      )
    )

Children
No Data