Need to find an alternative to getValue() in a scoped app

bookman1502
Giga Expert

Hi,

 

I need to know what the alternative to getValue() might be in a scoped app for the purpose of getting the string values of a user record referenced in the current GlideRecord object passed to a script include function. I've tried a number of things, including concatenating with +'', toString(), and getElement, but I have only managed to get the first_name and last_name of the user record but none of the other fields. Does anyone have any suggestions? Attached is my JSON object body formed in the code and the output I have from the stringified body printed in the logs.

 

Thanks

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

getValue() worked well for me in scoped application

getDisplayValue() also works well in scoped application

did you check value exists for those fields

Regards
Ankur

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

asifnoor
Kilo Patron

Hi,

getValue() works in scoped application.

Also you can use like this as well

gr.your_field_name.toString() 

Mark the comment as a correct answer and helpful if this helps.