Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to get only the displayed value in script?

jobin1
Tera Expert

Hi All,
We have 2 fields called u_html and u_message and these 2 fields are running on the u_email client table now when we click on the HTML button we will get only the u_html field but while checking in logs when doing this HTML button click I am getting both values in logs for u_html and message since we have stored both values in backend and just hiding from front end. Now the requirement is if the u_html filed is only visible in the form then i need to get the logs only for u_htm and u_message should be empty how can this be achieved tried the below 2 scripts but not working getting values for both field even if it not visible on the form


//issue getting both values at the same time
var DisplayValuehtml = current.getDisplayValue('u_html');//syntax1
//var DisplayValuehtml = current.getvalue('u_html');//syntax2
gs.log("ui1DisplayValuehtmlis"+DisplayValuehtml);
var DisplayValuemsg = current.getDisplayValue('u_message');//syntax1
//var DisplayValuemsg = current.getvalue('u_message');//syntax2

6 REPLIES 6

@jobin1 ,Client box was checked?

Please mark my response correct/helpful as applicable!
Thanks and Regards,
Rahul

yes checked.