How to access the currently active user informations in a Palantir Foundry code repository?

I am working in a TypeScript functions code repository in Palantir Foundry and need to access the currently active user credentials within my code. I have method where for each record created I need to set a property someModel.CurrentUserName to an actual name of currently logged-in user. The reason why I need this is that we need to keep track of who made a change to some record in our workshop app and display this name to other users. Is there any way how to directly achieve this in code repository? I have not tried much so far since I didn’t find any documentation on this. Any idea will be appreciated. Thank you

Hey -

A few options here:

  1. In workshop, you are able to access the user’s multipass attribute (thread)
  2. There is a multipass api (docs)that you can access in typescript functions to get info about a user from a given user id (thread)
  3. In an action, you can directly access the current user and pass it in to an action as a static default value. You can then use value formatting to have the user rid rendered as a name in workshop

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.