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

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

are you able to see sys_id of the user in script include logs?

Regards
Ankur

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

Yeah Ankur, I am able to get it to my_contact_sysID. but couldn't query it and proceed further.

Hi,

when you query customer_contact table does it work?

Regards
Ankur

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

Customer_contact  table doesn't have any records in our instance and contact field on work order is reference field of user table so I tried querying sys_user to get contact phone and email for user populated in Contact field