- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 11:34 AM
I have a scoped app where I need to check if the logged in user is in a certain team. As gs.getUser().isMemberOf() doesn't work in a scoped app, I moved that to a script include. But gs.getUser() still doesn't work as expected, the user shows as 'com.glide.sys.User@...........' when writing to system logs. As a result gs.getUser().isMemberOf() always returns false.
I could query the system tables but as I don't have the correct user object I'm not sure that will work either. Does anyone have a workaround for this?
Thanks
Ron
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 11:48 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 11:41 AM
Hi,
You can use the method gs.getUser().getID()
To get the sysID of the user, and use that to query the user from the sys_user table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 11:42 AM
As I've just typed this up and walked away from my desk to get more coffee, I think I know why.
I'm running a flow which is triggered by a record being created, that flow runs as the system user. Which would mean I need to pass the reference to the user from the created record and do a gs.getUserByID or something, if that works in the Tokyo release.
Ron

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 11:48 AM
Yup, that should work. The method to use is:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 11:54 AM
This works for me on scope. In PDI