Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Populate a reference field in user table

Saurabh8
Kilo Expert

Hi Team,

Below is the BR which I have written to create users in the "sys_user" table but am stuck in one place where I need to populate a reference field. ( Company Field )

What should be the exact line of code? ( The company name exists in the table but while I am trying to do a dot walk to get this value but it is note getting populated )

 

find_real_file.png

 

find_real_file.png

Thanks and Regards,

Saurabh Chatterjee

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron

Hi,

just update line as this

gr.u_callercompany = 'sysId'; // give sysId here directly

Regards
Ankur

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

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron

Hi,

just update line as this

gr.u_callercompany = 'sysId'; // give sysId here directly

Regards
Ankur

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

Thank you Ankur!

Aman Kumar S
Kilo Patron

Either use setValue("your_sys_id");

if you want to use setDisplayValue("your_company_name")

Best Regards
Aman Kumar

Thank you Aman!