Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

how to check roles for vendor contact in servicenow?

Nandhini Sri
Tera Contributor
 
3 REPLIES 3

Hayo Lubbers
Kilo Sage

It depends a bit where, but a Vendor contact should have snc_external.

Serverside : gs.hasRole('snc_external')

Samaksh Wani
Giga Sage

Hello @Nandhini Sri 

 

The following are the roles of it.

 

Vendor assessment reviewer

[sn_vdr_risk_asmt.vendor_assessment_reviewer]

 

Vendor contact

[snc_external]

 
 

Vendor risk assessor

[sn_vdr_risk_asmt.vendor_assessor]

 

 

Vendor risk manager

[sn_vdr_risk_asmt.vendor_risk_manager]

 

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.

 

Regards,

Samaksh

Amit Gujarathi
Giga Sage
Giga Sage

Hi @Nandhini Sri ,
I trust you are doing great.

To check the roles for a vendor contact in ServiceNow, we can utilize the gs.hasRole() method on the server-side. Specifically, we will be checking if the user has the role of "snc_external," which indicates that the user is a Vendor contact.

Here's the code snippet for checking the role on the server-side:

 

// Server-side script to check if the current user has the role of "snc_external"
var isVendorContact = gs.hasRole('snc_external');

// You can use the boolean value 'isVendorContact' to make further decisions in your IT asset management process.
// For example, you can perform actions specific to a Vendor contact based on the 'isVendorContact' value.

 


Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi