How to access user info in a workflow script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2019 08:43 AM
I have a catalog item where one of the variables is to select a user from sys_user table (workflow.variables.u_user).
How can I get the value of a custom date attribute (u_expires) of that user in the workflow?
If I enter the following variables into a log statement:
var current = workflow.variables.u_user;
var thename = current.getDisplayValue();
var expy = gs.getUser().getUserByID('current').getRecord().getValue('expires');
var expy2 = gs.getUser().getUserByID('current').getEmail();
current displays a sys_id
thename displays the user's name correctly
expy is undefined
expy2 is null
How can I access the variable from the sys_id?
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2019 08:54 AM
FYI, also:
If I log:
var expires = current.u_expires
It is null.
I should be able to dot-walk, no?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2019 09:03 AM
Try
var expy = current.variables.u_user.u_expires
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2019 09:24 AM
No. Says it is undefined.
I even tried current.variables.u_user.title just so I can have a good field and it was undefined also.
I print the sys_id of u_user (bc820c0ddbf26fc4ed2d8a50399619f1) and verify that this is the correct user and it is. I should be able to dot-walk but keep getting undefined.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2019 09:35 AM
What's datatype of u_expires on sys_user table?
Regards,
Sachin