Skip to content

Commit e43a1b3

Browse files
authored
Merge pull request #261 from thorn91/main
added glide query folder and simple example
2 parents ac36a1d + d2e45f7 commit e43a1b3

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
(function getUserRoles() {
2+
// sample user
3+
var userName = 'bow.ruggeri';
4+
5+
var roleQuery = new GlideQuery('sys_user_has_role')
6+
.where('user.user_name', 'bow.ruggeri')
7+
.select(['role$DISPLAY', 'role.active', 'user$DISPLAY', 'user.email'])
8+
.toArray(100);
9+
10+
gs.log(JSON.stringify(roleQuery, null, 2));
11+
})();
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Get User's Roles from User Name
2+
3+
GlideQuery's can greatly simplify extracting information from queries, especially when dot walking.
4+
5+
This query retrieves a user's roles, and returns an array of objects with the the role's display
6+
value, the role's active status, the user's display value, and the user's email. Adding more
7+
fields is trivial with this format, and the query stream is very easy to follow.

0 commit comments

Comments
 (0)