Variables blank in Backend view but contain a value in Workspace

Amy V2
Mega Sage

Hi all,

 

Our organization recently implemented the Legal Service Delivery product. I'm fairly new to being an Admin for ServiceNow and am working through how our 3rd party implementation team configured our instance to make minor tweaks to certain forms. Somehow I tweaked a Catalog Policy or Client Script that resulted in a required field showing blank when I open the record in the backend. If I open the same record in Counsel Center (the workspace used for our "agents"... i.e. fulfillers) or in the Service Portal as the submitter, the field contains a value. All of our client scripts that clear variable values are onChange, but I would think just opening the record from the backend view doesn't change a variable. I've checked all the Catalog Policies for "Clear Value" if false and removed all of the ones that pertain to these fields.

 

Any ideas on how to fix this issue? My initial thought is that it has something to do with a client script and applying it to the Target record, but that's just a guess. I've searched the forums but feel that I must be using the wrong terminology (backend view or platform?) as I can't seem to find anything close to a possible answer. Most questions/replies referring to target records are in terms of ITSM (change requests, generated task records), which don't apply to us but may still be the right concept to follow, I'm just struggling to find a question similar to mine.

1 ACCEPTED SOLUTION

Hi Amy,

 

Paste sys_script_client.list into the Filter Navigator.

 

Add the following conditions to the filter, be sure to update clearValue('xxxxxxx') where xxxxx is your variable name.

 

CraigGruwell_0-1665833413172.png

 

 

View solution in original post

3 REPLIES 3

Craig Gruwell
Mega Sage

Hi Amy,

 

onChange client scripts run when something is changed (based on condition) as well as when the form/page is loaded.   If you suspect the behavior you are seeing is from a client script and you do not want the client script executed when the form/page loads, make sure you include the following at the top of the client script:

 

if (isLoading) {
return;
}

 

 

Some other items to check...

 

For the variable in question, once on the variable record, be sure to check all the UI policies listed on the 'UI Policy Action -> Variable' related list. 

 

You can also query the Client Script table for the script field containing  clearValue('xxxxxxx')   where xxxxx is your variable name.

 

Thank you for the reply Craig. We do have the (isLoading) piece on the script. Can you provide more specific instructions for how to query the Client Script table? Sorry to ask such a silly question but I'm a newb!

Hi Amy,

 

Paste sys_script_client.list into the Filter Navigator.

 

Add the following conditions to the filter, be sure to update clearValue('xxxxxxx') where xxxxx is your variable name.

 

CraigGruwell_0-1665833413172.png