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.

Reference Qualifier reverts to simple after Save

NathanHaywood
Tera Contributor

Hi,

 

I have added a script into the Reference Qual field after changing the Reference Qualifier to Advanced:

 

NathanHaywood_0-1695378192702.png

 

But after saving, it reverts to Simple:

 

NathanHaywood_1-1695378202619.png

 

 

Will this affect how it runs? Will it not run the script because it's showing as Simple or will it run anyway?

 

Thanks

4 REPLIES 4

Brad Bowman
Kilo Patron
Kilo Patron

It's reverting because the advanced is invalid.  It should start out javascript followed by the colon symbol, not : - that's a lovely replacement 'feature' on this site editor whenever javascript followed by a colon is typed. Reference qualifiers usually do not contain excessive extra spaces/tabs/crs and comments, so that might be throwing it off also.

Thanks Brad for your insight, it's appreciated. I have done what you suggested and it no longer reverts to simple! However, I am still having issues with the Reference Qualifier not working... Not sure if you can help with that at all? I initially asked the question here: https://www.servicenow.com/community/developer-forum/set-dynamic-filter-on-reference-field-lookup-li...

 

Many thanks and let me know if you need info at all!

 

*Updated script:

 

javascript:
var query;
if(current.getValue("u_affected_service")){
query = "cmdb_ci=" + current.getValue("u_affected_service");
} else {
query = "your cutomized query";
}

Hi @Brad Bowman  
Thanks for this information, it saved a lot of time for me as I was facing this same issue today. However , I have an query related to it. 
Where is ServiceNow it is configured? there must be some kind of script which is validating this condition I believe . I tried to look for it , but did not see anything. 
If you have the reference , please share. would like to see the backend configuration.

Ankur Bawiskar
Tera Patron
Tera Patron

@NathanHaywood 

try what Brad mentioned and share the status.

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