How to find the user record in user table with sys ID in Script Include from sysID retrieved from UI Action and retrieve other field values from User table

Sushma Uday C
Tera Contributor

We have Contact field, we are getting contact details from the form in UI action and passing the sys ID to script include, but not able to find same record on user table and retrieve the other field for the same record from user table.

Not sure what's going wrong in below script. Please below script include and UI action 

find_real_file.png

find_real_file.png

Thanks in Advance

18 REPLIES 18

Hi,

so when you query sys_user with user sys_id the row count is 0?

Are you in some custom scope and trying to query sys_user?

Any error in system logs for cross scope?

Regards
Ankur

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

Yeh Ankur, I am in custom scope applications trying access sys_user table.

@Sushma Uday C 

Hi,

So any error in system logs for cross scope that you are not able to access sys_user table in query?

Regards
Ankur

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

No errors in log, I am able to enter the table after glideRecord but not able to query the table with sys ID and there and then code is getting terminated.

Hi,

did you try to use try catch block to know the exception?

Regards
Ankur

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