Get a user from a specific department for a specific view

User393503
Tera Expert

I am using:

if(gs.getUser().isMemberOf('department')

It will work for retrieving a user in a specific group, but not a department.

6 REPLIES 6

Jaspal Singh
Mega Patron
Mega Patron

Hi,

You can try 

gs.getUser().getRecord().getValue('department')

Narsing1
Mega Sage

You can use like this

gs.getUser().getDepartmentID()

Thanks,

Narsing

Ankur Bawiskar
Tera Patron
Tera Patron

@User393503 

what's your exact requirement?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

chetanb
Tera Guru

Hello @User393503 

 

Use getValue() 

 

Try with -

if(gs.getUser().getRecord().getValue('department'))

 

if my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

Regards,

CB