company logo

  • Release notes
  • Unification
  • System & Network Scanning
  • Web Application Scanning
  • API Scanning
  • Phishing & Awareness Training
  • Cloud Scanning
  • Scanner Appliance
  • Device Agent
  • Asset Manager
  • Remediation
  • Continuous Monitoring
  • Vulnerability manager
  • On-prem deployment
  • Vulnerability tests
  • Email notifications
  • Security Center
  • Contact and opening hours
  • Security Tools
  • Data retention
  • Security Badge
  • Holm Security VMP
  • Troubleshooting
  • Policy scanning
  • Best practice
  • Scanning techniques
  • Scan profiles
  • Authenticated Network Scanning
  • Scan Issues
  • Optimization
  • Authenticated scanning
  • Get started
  • Microsoft Azure
  • Amazon Web services (AWS)
  • Google Cloud Platform (GCP)
  • Oracle Cloud
  • Whitelisting
  • Data privacy
  • Getting started
  • Ignore and disable
  • Notes and conversations
  • Unified Vulnerabilities
  • Comparison report
  • White-labeling
  • Monitoring profiles
  • Beyond Trust
  • Integrations
  • Authentication & security
  • Personal data
  • Sweden, Norway, Finland, India & SAARC (Swedish entity)
  • Netherlands & Belgium (Dutch entity)
  • Denmark (Danish entity)
  • United Kingdom (UK entity)
  • Malaysia & SEA (Hong Kong entity)
  • Knowledge Base

How do I find Assignment Group id and User id in ServiceNow?

A unique 32-character GUID identifies each record in ServiceNow (Globally Unique ID) called a sys_id.

sys_id of a record is important when writing a script, workflow, or other development tasks.

Here are ten different methods to find the sys_id of a record in ServiceNow:

Right-click or hamburger You can right-click the header bar of most forms and find the sys_id.

To get a sys_id from the header bar:

Navigate to the record where you are looking for a sys_id. 

servicenow current.assignment_group.sys_id

To get a sys_id from XML

  • Navigate to the record where you are looking for a sys_id

Right click the header bar and select Show XML. Alternately you can also click the Hamburger > Show XML

servicenow current.assignment_group.sys_id

Since the sys_id of a record is always part of the URL for a link to that record, it is possible to retrieve the sys_id by viewing the URL.

To get the sys_id from XML

Right-click the header bar and select Copy URL. Alternately you can also click the Hamburger > Copy URL

For example, an Incident with the following URL:

https://<instance name>.service-now.com/nav_to.do?uri=incident.do sys_id=23dc968f0a0a3c1900534f399927740e

The sys_id is : 23dc968f0a0a3c1900534f399927740e

  • Add an onload client script to show a sys_id function onLoad() { var incSysid = g_form.getUniqueValue(); alert(incSysid); }

The sys_id value of a record can be found in a business rule (or any other server-side JavaScript)

The sys_id value of a record can be found in a background script. Note: Test in a development instance first!

Login as an admin

Go to System Definition > Scripts - Background

Paste a script similar to this and click Run Script

servicenow current.assignment_group.sys_id

By adjusting the url of a record, you can add this URL Parameter to export the sys_id and all fields to CSV

Navigate to the list of records where you want to find the sys_id

Build your filter

Right-click the Filter, and select Copy URL

Paste the URL into a new browser window

Add &CSV&sysparm_default_export_fields=all to the end of the URL

A CSV file with all fields AND the sys_id is exported.

servicenow current.assignment_group.sys_id

Here is a creative way to use the Easy Import Template to export the sys_id data you are looking for.

Right click the header bar and select Import. Alternately you can also click the Hamburger > Import

Do you want to insert or update data? Update

Do you want to create an Excel template to enter data ? True

Include all fields in the template? True or False, your choice

Click Create Excel Template

Click Download

Open the Excel Spreadsheet

Select Page 1

servicenow current.assignment_group.sys_id

If you are using the  ServiceNow ODBC Driver  and a reporting tool, you can pull the sys_id field information easily.

servicenow current.assignment_group.sys_id

If you are using the  ServiceNow Rest API , you can also pull sys_ids

servicenow current.assignment_group.sys_id

Check this link (external): https://www.servicenowelite.com/blog/2020/9/29/ten-methods-to-find-sysid?rq=sys_ID

The Snowball

The Snowball

A ServiceNow Blog & Newsletter

Understanding sys_id’s and Reference Fields

What is a sys_id? In ServiceNow, a sys_id is a unique identifier for a specific record within a table. It is automatically generated by the system and used to identify and reference the record within …

Photo of author

Written by: Team Snowball

Published on: December 11, 2022

Buy The 'ServiceNow Developer Manual' Here!

Snowball - ServiceNow Developer Manual

Buy The " ServiceNow Developer's Manual " Now

We've packed over a decade of ServiceNow Development advice, into a single e-book.

Stripe Climate Badge

The Snowball will contribute 5% of your purchase to remove CO₂ from the atmosphere.

Table of Contents

What is a sys_id?

In ServiceNow, a sys_id is a unique identifier for a specific record within a table. It is automatically generated by the system and used to identify and reference the record within the table.

sys_id’s are 32 characters long and are always a unique combination of alphanumeric characters, so letters and numbers only.

The sys_id is typically used when building references between tables, or when performing a database query to retrieve a specific record.

Here’s an example of a sys_id:

It is important to note that the sys_id is unique to a given record within a table, and cannot be used to reference records in other tables.

It’s also important to never try to update the sys_id of any record, under any circumstance.

Why Are sys_id’s important?

Every record, on every table, has a unique sys_id.

sys_id’s are only relevant to ServiceNow admins and developers – as the end user has no need to even know that it exists, they just use the number field to differentiate records.

But sys_id’s are important in ServiceNow because they provide a unique and reliable way to identify and reference records within a table. They are used extensively throughout the platform, and are especially important when building relationships between tables, or when performing database queries to retrieve specific records.

To use sys_id’s, you can simply reference the sys_id of a record when building a reference between tables, or when performing a database query. For example, if you wanted to retrieve all records in the Incident table where the caller is a specific user, you could use the sys_id of the user record to specify the caller in your query.

It’s also important to note that the sys_id is typically hidden from view within the ServiceNow user interface, and can only be accessed by using the appropriate APIs or by using the sys_id field in a database query. This helps to ensure that the sys_id is not accidentally modified or deleted, which could cause problems with references and relationships between records.

In summary, sys_id’s are an important part of ServiceNow and provide a unique and reliable way to identify and reference records within a table. They are used extensively throughout the platform and are essential for building relationships and performing database queries.

Reference Fields and sys_id’s

ServiceNow uses a relational database, meaning that records can point to other records in different tables.

For example, when you have an incident, and you point the “Assigned To” field to the User [sys_user] table – then “Assigned To” becomes a reference field, and that value is a sys_id. This would be the value of the user.

In ServiceNow, a reference field is a special type of field that is used to create a relationship between two records in different tables. The reference field contains the sys_id of the related record, which allows the system to link the two records together.

For example, let’s say that you have two tables in ServiceNow: one for Incident records, and another for User records. If you want to create a relationship between an Incident record and the user who reported it, you could create a reference field on the Incident table that contains the sys_id of the related User record. This would allow you to easily retrieve the User record associated with an Incident, and vice versa.

In summary, the relationship between a sys_id and a reference field in ServiceNow is that the sys_id is used to identify and link records together using reference fields. The reference field contains the sys_id of the related record, which allows the system to easily retrieve and display information from the related record.

You can get the sys_id of any record by going to it’s form, and right-clicking on the form header. You’ll there see a drop-down list and you’ll see a “Copy sys_id” option.

Selecting that adds the current records sys_id to the clipboard of your computer.

You can also get it by Showing the XML of any record, and you’ll see that the sys_id is a column on every single table.

How To Use get() In A Script To Retrieve A Record

If you have the sys_id of a record, you can write a simple GlideRecord query, using get() to retrieve that record, and then do something with it.

Take the following example:

In this example, we first define the table and sys_id of the record we want to retrieve. We then use the GlideRecord class to create a new GlideRecord object and retrieve the record using the get() method, passing in the sys_id as an argument. Finally, we check if the record was retrieved successfully, and do something with the record if it was found.

This is just a simple example, but it shows how you can use the sys_id of a record to retrieve it from the database in ServiceNow.

You can then use the retrieved record to perform further operations, such as updating its values or referencing it in other database queries.

This should help you better understand how sys_id’s work and what they truly are.

Let us know what you think about our article on sys_id’s.

What Do You Think About This Article?

guest

About Team Snowball

ServiceNow – Understanding the stats.do page

How to make an api call to servicenow with python.

ServiceNerd

ServiceNow Advanced Reference Qualifier | How to filter the Assignment group based on Assigned To

Been in a predicament in ServiceNow, where you know the person a task needs to be assigned to, but don’t know the right group? I got you!

In this video, we add an advanced reference qualifier on a dictionary override on the assignment group fields (for incidents) that calls a server side script include to run some funky glideRecord queries and return as back a refined list of group sys_id’s. Its then these groups that are shown when you click the Assignment Group magnifying glass.

https://docs.servicenow.com/en-US/bundle/tokyo-platform-administration/page/script/server-scripting/concept/c_ReferenceQualifiers.html

https://www.servicenow.com/community/developer-forum/dynamic-advanced-reference-qualifier-examples/m-p/1386576

Reference Qualifier bit:

javascript:new global.AssignmentGroupFilter().refineAssignmentGroup(current.assigned_to)

Script Include:

Tags: advanced reference qualifier beth anglin GlideRecord reference field reference qualifier script include servicenerd servicenow admin servicenow demo servicenow tutorial sysid in

You may also like...

servicenow current.assignment_group.sys_id

How to create a Variable Set

ServiceNow Flow Diagramming

ServiceNow San Diego Flow Diagramming | Flow Designer stuff #Shorts

ServiceNow Hyperlink

ServiceNow: How to embed hyperlinks in work notes | clickable links

  • Next story Flow Designer Error Handling ServiceNow | How to…
  • Previous story ServiceNow GlideAggregate Count | Is it better than GlideRecord getRowCount()

ServiceNerd_JustinMeadows

All Videos / New Features / Tips & Tricks

AI in ServiceNow with Justin Meadows | What does it mean?

February 27, 2023

ServiceNow ChatGPT

New Features / Tips & Tricks

What is ChatGPT and Can We Use it for ServiceNow

December 18, 2022

  • Recent Posts
  • Popular Posts
  • Recent Comments

ServiceNow Process Automation Designer (PAD) | What does it do?

ServiceNow Process Automation Designer (PAD) | What does it do?

December 19, 2023

servicenow current.assignment_group.sys_id

All Videos / Flow Designer

“Do the Following Until” Flow Logic in ServiceNow Flow Designer

September 1, 2023

Dynamic Flow

Exploring Dynamic Flow and Get Flow Output Logic in ServiceNow Flow Designer!

July 24, 2023

servicenow current.assignment_group.sys_id

All Videos / Flow Designer / Tips & Tricks

Flow Designer Error Handling ServiceNow | How to…

July 3, 2023

servicenow current.assignment_group.sys_id

June 11, 2023

ServiceNow Hyperlink

Service Catalog / Tips & Tricks

October 30, 2022

ServiceNow Import Set API

Integrations

ServiceNow Inbound REST API | Import Set API

September 12, 2022

servicenow current.assignment_group.sys_id

New Features / Shorts

ServiceNow San Diego Polaris | ServiceNow Next Experience UI #SanDiego #Polaris #Shorts

February 7, 2022

ServiceNow Flow Template Builder

Flow Designer

ServiceNow Flow Template Builder | Create a template using Flow Template Builder

October 6, 2022

servicenow current.assignment_group.sys_id

  • artificial intelligence business rule client script flow Flow designer Flow designer development flow designer for service catalog flow designer servicenow flow designer servicenow orlando flow designer servicenow training flow design tutorial g form glideajax GlideRecord integration hub onload script include service catalog service catalog in servicenow service catalogue servicenerd servicenow servicenow admin servicenow administrator training servicenow community servicenow demo servicenow developer servicenow developer training servicenow flow servicenow flow designer servicenow flow designer approval servicenow flow logic servicenow glideajax example ServiceNow how to servicenow integration servicenow microsoft teams servicenow new features ServiceNow Next Experience ServiceNow Polaris servicenow reference field ServiceNow San Diego servicenow shorts servicenow training servicenow tutorial subflow

The Now Platform® Washington DC release is live. Watch now!

ServiceNow Community servicenow community

  • English (US)
  • English (UK)
  • Portuguese (Brazilian)

developer

  • ServiceNow Community
  • IT Operations Management
  • Set Assignment Group in INC from Alert when Alert ...
  • Subscribe to RSS Feed
  • Mark Question as New
  • Mark Question as Read
  • Float this Question for Current User
  • Printer Friendly Page

Set Assignment Group in INC from Alert when Alert is ReOpen

Henrik Jutterst

  • Mark as New
  • Report Inappropriate Content

‎05-10-2023 04:54 AM

HenrikJutterst_0-1683719566429.png

Solved! Go to Solution.

  • Event Management

‎05-26-2023 12:04 AM

View solution in original post

  • All forum topics
  • Previous Question
  • Next Question

SNUG AM

‎05-10-2023 11:35 PM

‎05-11-2023 01:07 AM

‎05-11-2023 10:36 AM

  • How to add "assigned to" in a activities log filter on Alert in ITOM forum a week ago
  • ARTICLE: Alert Correlation Rule Advanced Script in ITOM forum 03-26-2024
  • Closing a Primary Alert in ITOM forum 02-14-2024
  • Need to stop the incident reopen when the problem ticket is attached with it in ITOM forum 02-12-2024
  • problem managemt in ITOM forum 02-01-2024

servicenow current.assignment_group.sys_id

Advance Your Career

How To Use gs.getUser().isMemberOf() In ServiceNow

How To Use gs.getUser().isMemberOf() In ServiceNow

How to use gs.getuser().ismemberof() in servicenow, introduction to .ismemberof().

As a ServiceNow Developer there are many situations where you will need to check if a user is a member of a specific group.

You may be given the requirement to restrict read or write access to a field based on a user group, or to validate that the logged in user is a member of a group when a form loads.

You can accomplish these things and more in ServiceNow by using gs.getUser().isMemberOf() . This line of code is an extremely useful tool for a developer to verify group membership quickly and easily.

This article will explain what gs.getUser().isMemberOf() is in ServiceNow and demonstrate how to use it in real world scenarios. Let's get started!

How To Use gs.getUser().isMemberOf() In Code

The gs.getuser() method.

First, we're going go break down gs.getUser().isMemberOf() to better understand how it works.

The first method in this line of code, gs.getUser() , will return a user object for the current logged in user. Since “gs” is the GlideSystem API , the gs.getUser() method is only available server-side, and can therefore be used in any server script including Access Controls, Business Rules, and Script Includes.

It will not be available client-side for use in Client Scripts or UI Policies.

To learn more about the basics of gs.getUser(), check out our complete guide to using gs.getUser().

The isMemberOf() method

The second method, isMemberOf() , takes the parameter of a group, and in this case will check if the user who is currently logged in is a member of that group.

The parameter can either be the group name or the groups sys_id.

For example, the below code will find out if the currently logged in user is a member of the 'Hardware' group (by name) and the 'ITSM Developers' group (by sys_id).

The code returns true or false based on if the user is in the group. Developers could then use the output to script some additional actions in the system. In the following example the current user is not in the 'Hardware' group, but is in the 'ITSM Developers' group.

The output would be: 

A close-up of a wordDescription automatically generated

Now, let’s look at some actual use cases for using gs.getUser().isMemberOf() .

Real World Examples

Example 1 - using ismemberof in an acl (access control list).

One common place that gs.getUser().isMemberOf() is used is in Access Control (ACL) scripts.

Developers can script a condition for Access Controls in order to control CRUD operations on a table or field. You could use gs.getUser().isMemberOf() in an ACL script to create a rule which checks the logged in user’s group membership as a condition for the access control.

The following example shows a script on a write ACL for the Channel (contact_type) field on the Incident table. The “if” statement checks if the current user is a member of the Service Desk group.

ACL scripts should return true or false and will only execute if the script evaluates to true. In this case, the script returns true if the logged in user is a member of the Service Desk group, and as a result that user will be able to write to the Channel field.  

If the user is not a member of Service Desk, the field will be read only as shown below. Using gs.getUser().isMemberOf() in Access Controls is a great way to restrict table/field operations based on group membership.

Channel field read-only on Incident Form in ServiceNow

Example 2 - Using isMemberOf Client Side (with g_scratchpad)

As mentioned earlier, gs.getUser().isMemberOf() is part of the server-side API which means it cannot be directly used in client-side scripts.

However, as a workaround, developers can use the method in a server script and pass the value to the client. This is a clever way to be able to check the user’s group membership on a form, which can be useful in Client Scripts and UI Policies.

One way to accomplish this is to utilize gs.getUser().isMemberOf() along with g_scratchpad . Developers can use the g_scratchpad object to pass data from the server to the client.

Business Rule Code

The below example shows a Display Business Rule script on the Incident table. The rule will execute every time a form loads on the Incident table. In the script we are storing the result of gs.getUser().isMemberOf() in a g_scratchpad variable.

Remember, gs.getUser().isMemberOf() will return either true or false, and that result is what will be captured in the variable. Essentially, every time a record is displayed on the Incident table, this result will be added to the g_scratchpad object.

Client Script Code

To access the g_scratchpad object client-side, we will utilize a Client Script.

In our example, we are using an onLoad Client Script on the Incident table. Similar to our first example, the result of gs.getUser().isMemberOf() (via g_scratchpad) can be used as a condition to determine additional actions in the system.

The “If” statement will evaluate to true or false. A use case for this could be if the condition evaluates to true (i.e. if the logged in user is a member of the Service Desk, then make some field visible)

The alert is used to show how the value appears when retrieved on the client. The following alert was triggered when the form loaded for a user who is in the Service Desk group. You can see by the result it alerts (true), that the value is now available to use on the client side. Now you can use it for whatever you may need! A few things might be

  • Making a field mandatory
  • Hiding a field
  • Setting the value of a field based on if the scratchpad is true/false

Alert message on the Incident Form in ServiceNow Showing isMemberOf value

Even though gs.getUser().isMemberOf() is not available client-side, developers could use this approach to take advantage of the functionality to check group membership. Alternatively, we could have used GlideAjax and a Script Include to pass the result of gs.getUser().isMemberOf() from the server to the client. 

These are just a few scenarios where Developers can utilize gs.getUser().isMemberOf() .

Checking Group Memberships For Other Users

You may be wondering how to check group membership for users who are not the logged in user. Luckily, ServiceNow provides a way to do that also.

This can be accomplished by adding the getUserByID() method to the code we’ve been discussing and then adding the user's User ID as the parameter. The getUserByID() method takes a parameter of either the User ID or the sys_id of the user.

The below script shows how to check if any user is a member of any group, regardless of if they are the currently logged in user or not.

Putting It All Together

The topics and examples discussed in this article may be some of the more common requirements that you see while working in ServiceNow.

Almost every project I've ever been on, I've had at least one story that asks for something to happen based on a users group membership. It's a great tool to have in your arsenal, and you can knock out stories faster than ever if you have a good background of it!

We hope this article has helped you understand how to use gs.getUser().isMemberOf() in ServiceNow so that you are able to utilize it in your own scripts and take advantage of it. Happy coding!

Looking for something else? Check out our other posts below!

  • ServiceNow Cheat Sheets
  • Exam Study Guides
  • How To Export Your Favorites (before a clone)

How To Script In Flow Designer

  • How To Call A Script Include From A UI Action
  • How To Call A Script Include From A Business Rule
  • How To Use gs.getUser().hasRole()

servicenow current.assignment_group.sys_id

GlideRecord Cheat Sheet

servicenow current.assignment_group.sys_id

How To Get Certified In ServiceNow

servicenow current.assignment_group.sys_id

How To Move Updates Between Update Sets In ServiceNow

servicenow current.assignment_group.sys_id

How To Add A Hyperlink To A Notification In ServiceNow

servicenow current.assignment_group.sys_id

How To Dot-Walk Inside of a Client Script in ServiceNow

© Snowycode 2022. All rights reserved.

ServiceNow Guru Logo

User Object Cheat Sheet

No matter what system you’re working in, it is always critical to be able to identify information about the user who is accessing that system. Being able to identify who the user is, what their groups and/or roles are, and what other attributes their user record has are all important pieces of information that allow you to provide that user with a good experience (without giving them information they don’t need to have or shouldn’t have). ServiceNow gives administrators some pretty simple ways to identify this information in the form of a couple of user objects and corresponding methods. This article describes the functions and methods you can use to get information about the users accessing your system.

GlideSystem User Object

T he GlideSystem (gs) user object is designed to be used in any server-side JavaScript (Business rules, UI Actions, System security, etc.). The following table shows how to use this object and its corresponding functions and methods.

It is also very simple to get user information even if the attribute you want to retrieve is not listed above by using a ‘gs.getUser().getRecord()’ call as shown here…

g_user User Object

The g_user object can be used only in UI policies and Client scripts. Contrary to its naming, it is not truly a user object. g_user is actually just a handful of cached user properties that are accessible to client-side JavaScript. This eliminates the need for most GlideRecord queries from the client to get user information (which can incur a fairly significant performance hit if not used judiciously).

It is often necessary to determine if a user is a member of a given group from the client as well. Although there is no convenience method for determining this from the client, you can get the information by performing a GlideRecord query. Here’s an example…

To get any additional information about the currently logged-in user from a client-script or UI policy, you need to use a GlideRecord query. If at all possible, you should use a server-side technique described above since GlideRecord queries can have performance implications when initiated from a client script. For the situations where there’s no way around it, you could use a script similar to the one shown below to query from the client for more information about the currently logged in user.

Useful Scripts

There are quite a few documented examples of some common uses of these script methods. These scripts can be found on the ServiceNow docs site .

servicenow current.assignment_group.sys_id

Mark Stanger

Date Posted:

June 23, 2021

Share This:

29 Comments

' src=

Thanks for the great tips… My personal favorite:

gs.getUser().getRecord().getValue(‘title’);

never knew you could do that, awesome!

I was looking for a way to get the default set to the User Time Zone. Looked everywhere and it was on my favorite site..!

javascript:gs.getUser().getRecord().getValue(‘time_zone’);

Note that if you use this method, and you have the time zone selector turned on, you may run into issues. The time zone selector sets the User’s Session TZ, but not their default.

For more consistent results, use the following: var tzStr = gs.getSession().getTimeZoneName(); // “US/Pacific” var jTZ = gs.getSession().getTimeZone(); // sun.util.calendar.ZoneInfo java object. APIDoc linked below

Java doc ZoneInfo api: http://www.docjar.com/docs/api/sun/util/calendar/ZoneInfo.html

Thank you for the great work… finally one place to get the information about the UserObject stuff…

Just one note:

– the hasRole() returns true, if the user has the role specified (e.g. hasRole(role)) OR the admin role.

– to get a true/false for a specific role, use hasRoleExactly(role), which will only return true, if the user has the itil-role.

' src=

Thanks for the feedback. This method had some issues in the past (which is why I didn’t include it). It looks like it’s in the official ServiceNow doc now though so hopefully I’m safe in including it here :). I just added it to the article above.

I looked at the Usage example for “isMemberOf()” and also checked the wiki article for the function “getUserByID” ( http://wiki.servicenow.com/index.php?title=Getting_a_User_Object&redirect=no#Method_Detail ) but I cannot get it to work.

Is this function maybe retired?

Some code I played with is:

I’m not having any luck with it either. I haven’t heard of it being retired, but you’ll probably need to contact ServiceNow support to see. Please post back here with your findings.

Here we go: first we have to initialize a variable with “getUser()”. After that we can get any user object using it’s sys_id or UserID. Below the updated code to make the example work:

Thanks Andreas! I’ve updated the table above with this solution.

is it possible to check whether he/she is one of the member of Assignment group? Please guide me friends.

Yes. Check out ‘isMemberOf’ above.

sorry Mark. i forget to mention, is it possible to do this in client script?

Not directly. You could easily do a client-side GlideRecord query against the ‘sys_user_grmember’ table to find that though. Just make sure to do an asynchronous gliderecord query with a callback. You can find an example of this type of script here… https://servicenowguru.com/scripting/client-scripts-scripting/gform-getreference-callback/

Thanks Mark.

Thanks for all the info, very handy and interesting indeed. One question though, is there a method like the var hasRoleExactly that will work server-side? I can get it to work okay client-side but that’s it.

Thanks Martin

I don’t know of any built-in way of doing this, but you could always query the ‘sys_user_has_role’ table directly or create an on-demand script include that would allow you to call it in a shorthand way.

Thanks Mark, I thought that might be the alternative :)

How does one get the client’s business number? The wiki shows how to get the mobile number, but not the business number.

http://wiki.servicenow.com/index.php?title=Getting_a_User_Object

Up above I explain for both back-end and client-side code how you can get any attribute even if there’s not a specific function defined. You can get any attribute from the back-end like this. gs.getUser().getRecord().getValue(‘title’);

If I understand that correctly, then I could use this in a script of a workflow that works on a condition of an incident being submitted, to set the value of phone for the incident, to the user’s business phone, with the following script?

current.u_cos_contact_no = gs.getUser().getRecord().getValue(‘phone’);

Correct. As long as ‘phone’ is the name of the field you want to pull the value from.

On my incident form, “Contact Phone” variable is called u_cos_contact_no.

In my client’s user form, “Business Phone” variable is called phone.

For my workflow, would I want to do a custom script, or simply put do a Set Values, and then use javascript:gs.getUser().getRecord().getValue(‘phone’) ?

An update, I made a script step in the workflow, and the following works in my system:

var businessphone = gs.getUser().getRecord().getValue(‘phone’); current.u_cos_contact_no = businessphone;

Now to try it as a Set Value step in the workflow, with javascript:gs.getUser().getRecord().getValue(‘phone’); Not sure if it will work, but it’s work a shot to eliminate extra steps in the workflow.

Sorry to keep filling this up, but I can’t figure out how to edit my previous post.

On further testing, javascript:gs.getUser().getRecord().getValue(‘phone’) does work in a Set Value step of the workflow, however it pulls the phone number of the user logging in the incident, not the phone number of who the “client” has been set to for the incident. Any way to modify this?

Much thanks Mark

I wanted to know if we could access the company of the user involved, using the g_user field.

Thanks and Regards, Vivek

Sure. Take a look at the ‘title’ example at the bottom of the article. It shows how you can use a GlideRecord query to get any additional information about the user (including company) that you want.

These articles are so helpful, thank you Mark for making this public information.

Extremely helpful, thank you, Mark!

Article still relevant after 13 years. Amazing !

Comments are closed.

servicenow current.assignment_group.sys_id

Randall King says:

  • Business rules
  • Client scripts
  • Content management
  • Email Notifications
  • General knowledge
  • Graphical workflow
  • Integration
  • Knowledge Management
  • Miscellaneous
  • Relationships
  • Script includes
  • Service Portal
  • Single Sign-on
  • System Definition
  • Web Services

Related Posts

GlideRecord Query Cheat Sheet

GlideRecord Query Cheat Sheet

Generate a GlideRecord Query for a List

Generate a GlideRecord Query for a List

Comparing the Differences Between Two Strings

Comparing the Differences Between Two Strings

Fresh content direct to your inbox.

Just add your email and hit subscribe to stay informed.

servicenow current.assignment_group.sys_id

Since 2009, ServiceNow Guru has been THE go-to source of ServiceNow technical content and knowledge for all ServiceNow professionals.

  • Application Portfolio Management (APM) assessment challenges
  • Knowledge Translation using Localization Framework and Azure
  • Localization framework fulfillment (LP, LRITM, LFTASK)

© Copyright 2009 – 2024 | All Rights Reserved

web analytics

developer portal logo

Your browser or one of your plugins is not allowing JavaScript to be run. This is a bummer since the ServiceNow Developers Site is dynamic and depends on JavaScript to function. If you want to visit this site, please disable the plugin, activate this site for JavaScript or use another browser.

IMAGES

  1. Update a ServiceNow Group : TechWeb : Boston University

    servicenow current.assignment_group.sys_id

  2. 如何从客户端脚本servicenow调用脚本include?-腾讯云开发者社区-腾讯云

    servicenow current.assignment_group.sys_id

  3. How to Create an Incident Report Based on Assignment Group in ServiceNow

    servicenow current.assignment_group.sys_id

  4. Exercise: Make a List Dynamic

    servicenow current.assignment_group.sys_id

  5. ServiceNow

    servicenow current.assignment_group.sys_id

  6. Using the ServiceNow Service Desk Integrations

    servicenow current.assignment_group.sys_id

VIDEO

  1. ServiceNow Current Previous Object in BR Part1

  2. Conversational Interfaces Academy: What's New in Vancouver

  3. SERVICENOW Assignment Data Lookup Rules and Transfer maps @SERVICENOW_Beginners

  4. Conversational Interfaces Academy: Different ways connecting to a Live Agent

  5. Stop using .sys_id and use getUniqueValue() instead!..your future self will love you for it!

  6. ServiceNow Reports Session 8 : How to create Data set reports in servicenow

COMMENTS

  1. Configure group types for assignment groups

    Use the Type field to define categories of groups. Once defined, you can use these categories to filter assignment groups based on the group type using a reference qualifier. For example, when selecting.

  2. Assigning sys_id display value to string field in servicenow

    Assigning sys_id display value to string field in servicenow. Ask Question Asked 1 month ago. ... Issue populating assignment_group in servicenow via REST API. 0. ... Unable to Understand How Current Divides in Parallel Circuits more hot questions Question feed ...

  3. How do I find Assignment Group id and User id in ServiceNow?

    Here are ten different methods to find the sys_id of a record in ServiceNow: Right-click or hamburger. You can right-click the header bar of most forms and find the sys_id. To get a sys_id from the header bar: Navigate to the record where you are looking for a sys_id. Right-click the header bar and select Copy sys_id.

  4. Understanding sys_id's and Reference Fields

    The reference field contains the sys_id of the related record, which allows the system to easily retrieve and display information from the related record. You can get the sys_id of any record by going to it's form, and right-clicking on the form header. You'll there see a drop-down list and you'll see a "Copy sys_id" option.

  5. How to get all users from assignment group in service now?While

    As you can see in your image the information for the groups is stored in table sys_user_group. The information which users are assigned to which group is stored in table sys_user_grmember. So the REST query could be a GET to this URL:

  6. ServiceNow Advanced Reference Qualifier

    In this video, we add an advanced reference qualifier on a dictionary override on the assignment group fields (for incidents) that calls a server side script include to run some funky glideRecord queries and return as back a refined list of group sys_id's. Its then these groups that are shown when you click the Assignment Group magnifying glass.

  7. Assignment Group in field is missing from instance

    The 'Assignment Group' (Or any field) field on the Incident or Task tables shows the sys_id of the reference field within the value box.

  8. Exporting Data with Sys IDs

    ServiceNow provides a number of ways to export data from the platform. All of these methods are simple to use, but something that isn't always obvious is how to include the Sys ID value associated with a record in the export. Depending on how you plan to use the exported data, having the Sys ID is important. If you plan to do any kind of reconciliation or bring that data back into the ...

  9. Set Assignment Group in INC from Alert when Alert is ReOpen

    I have added the Assignment Group field to the Alert form and done some modifications to the Script Include so that it should use the Assignment Group on the Alert record when it's creating an incident record and assign the INC to the same group as the assignment group on the Alert record. This works fine when I create a Quick Incident from an ...

  10. Ten Methods to Find SysID

    Here are ten different methods to find the sys_id of a record in ServiceNow: 1. RIGHT CLICK OR HAMBURGER. You can right click the header bar of most forms and find the sys_id. To get a sys_id from the header bar. Navigate to the record where you are looking for a sys_id. Right click the header bar and select Copy sys_id.

  11. How To Use gs.getUser().isMemberOf() in ServiceNow

    You could use gs.getUser ().isMemberOf () in an ACL script to create a rule which checks the logged in user's group membership as a condition for the access control. The following example shows a script on a write ACL for the Channel (contact_type) field on the Incident table. The "if" statement checks if the current user is a member of ...

  12. User Object Cheat Sheet

    No matter what system you're working in, it is always critical to be able to identify information about the user who is accessing that system. Being able to identify who the user is, what their groups and/or roles are, and what other attributes their user record has are all important pieces of information that allow

  13. The GlideUser (g_user) Class

    The g_user.userID property contains the record's sys_id. Every record has a 32-character unique sys_id. Although you could concatenate the output of g_user.firstName with g_user.lastName, the convenience method, g_user.getFullName() concatenates the two. The GlideUser API also has methods for determining if a user has a specific role. For example:

  14. Assignment group of record

    The assignment group change on the change of the group membership of the user assigned to the record.

  15. How to configure Group Members (sys_user_grmember) edit ...

    This article demonstrates how to configure Group Members (sys_user_grmember) edit capability, so that only the Group Manager is able to edit (as in add/remove) members from the group.