How to get the value from referenced field and display it as default value to the variable of record producer?

s_s
Giga Contributor

Hello community.

I would like to get the value from referenced field and display it as default value to the variable of record producer.

For example, I set default value to variable of record producer as below to get the 'name' value from user table .

find_real_file.png

And then I can confirm that the variable has 'name' value as default value on the portal.

find_real_file.png

 

However, I can't get the value 'department'.

Even if the same setting is made(gs.getUser().getRecord().getValue('department')), the department value cannot be obtained.

I appreciate if you could answer it.

1 ACCEPTED SOLUTION

Harsh Vardhan
Giga Patron

try now. 

 

javascript:gs.getUser().getRecord().getDisplayValue('department')

View solution in original post

9 REPLIES 9

Hi, yes, you're getting the value of the department of the logged in user through the method I mentioned.

That is the value, the sys_id, which...when set as the default value for a reference field that points to department will show you "Customer Support", just like in your screenshot.

Currently, it seems like you have a string field that you are trying to put this in...and you want the DISPLAY VALUE, not the value, but the display value.

I'm saying...if you know that that field will hold a department, then make that field a reference to the departments...simple as that. Not a string field...

Please mark reply as Helpful/Correct, if applicable.


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi,

I'm glad you found the answer you were looking for. What I was trying to do was get you to use the field, correctly, in my opinion. If that field is always expecting a department...then make it a reference field to the departments. That allows for a more "complete" process as you're getting values that are still in the system (for any reporting needs), ITIL users are able to preview that field and get any other information that may be relevant (such as a description or manager, etc.) and other platform specific reasons. But...in the end, it's your requirements and I'm glad you got it figured out!

Take care!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hello.

Thank you for your information and corporation.

It was helpful for me.

Harsh Vardhan
Giga Patron

try now. 

 

javascript:gs.getUser().getRecord().getDisplayValue('department')

Harsh Vardhan
Giga Patron

screenshot for reference. 

 

find_real_file.png

 

If i answered your query kindly mark it as correct.