Internal function to get current logged in user
- This topic has 1 reply, 2 voices, and was last updated 9 years, 3 months ago by .
Viewing 1 reply thread
Viewing 1 reply thread
- You must be logged in to reply to this topic.
Home › Forums › Classic DFFS › Internal function to get current logged in user
Tagged: functions
I frequently want to grab the name of the current logged in user in order to create a record of who added a comment in a log field. I have accomplished this in the past by adding a column to my list called CurrentLoggedInUser (single line of text), then creating a rule to populate it each time the form loads by setting its value to {currentUser}, but I’m sure I can do it more directly. Is there an internal DFFS function I can use in my custom javascript to grab the current user’s display name?
You can use this in the Custom JS:
var userInfo = spjs.utility.userInfo(spjs.dffs.data.currUserID); // userInfo is an object with multiple properties - use console.log(userInfo) to see all // Here is the title alert(userInfo.Title);
Alexander