How to translate objectGUID field values to user table correlated ID values using Script.

pdisrilatha
Tera Contributor

How to translate Object GUID field (base 64 language code) to user table correlated ID language using Script.

Please suggest you are response it will helps me.

pdisrilatha_0-1728020528495.png

pdisrilatha_1-1728020602868.png

 

 

6 REPLIES 6

Ravi Gaurav
Giga Sage
Giga Sage

Hi @pdisrilatha 

You can use the below Demo Script :-



var base64Guid = "YOUR_BASE64_GUID_HERE";

// Decode the base64 GUID
var decodedGuid = GlideStringUtil.base64Decode(base64Guid);

// Assuming the GUID corresponds to a specific user field like 'user_guid' (custom field)
var userGR = new GlideRecord('sys_user');
userGR.addQuery('user_guid', decodedGuid);
userGR.query();

if (userGR.next()) {
// Output the correlated user information
gs.info('User found: ' + userGR.getValue('user_name') + ' | Sys ID: ' + userGR.getUniqueValue());
} else {
gs.info('No user found for the provided GUID.');
}
})();

--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

 YouTube: https://www.youtube.com/@learnservicenowwithravi
 LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

HI @Ravi Gaurav,

 

we need write a script in transform script inside transform map.

need to get the value of Object GUID value into a variable then then decode that value and map script to Correlated ID filed in AD group table.

palanikumar
Mega Sage

Hi,

Your requirement is not clear. What are you trying to do? Are you trying to update data from two different source?

As per my knowledge Object GUID is from On Prem Active Directory. The data I see in the correlation ID looks like it is holding Object ID from Azure Active Directory. There is no way to convert Object GUID to Object ID and vice versa.

If you're trying to update the User Record that are populated by On Prem Active Directory with Azure AD, then use email id as unique field to update data. If you have different requirement then share the information in detail

Thank you,

Palani

Thank you,
Palani

Hi @palanikumar.,

1.I need to translate object GUID field values to corelated id field values for that we need to use script.

2.By using transform maps i need to get data every month into target table