Reference Qualifier on the same table

danielbartholom
Mega Expert

Hi I am looking for some help please

I have a Cat Item on the Service Portal that has a lookup select box variable that references the technical system table.

I would like to create a new column on the technical system table called Data Tool Network Path. When I open the form for a selected Technical System

I will then enter the correct path here. There will be different paths for different Technical Systems.

What I am looking for is the correct reference qualifier to present the following on the cat item form

When someone selects a Technical System that has a path applied is there a way I can have this come up a a string field so the requester can see

the path for review on the form?

So on the form, the requester selects a Technical System from the lookup select box

The correct path should then appear in a new variable (string maybe?) below.

To date this has been completed by Catalog UI policies but I am hoping I can streamline this some what.

I hope the above makes sense and any help would be most appreciated. Happy to provide more information if anything is unclear. Even if this does not work on a string variable I am still interested to know how you can run a ref qual on the same table?

1 ACCEPTED SOLUTION

HI,

 

I saw your New thread. Will look into this and reply asap.

Can you close this thread by marking answer as correct.

Thanks,
Ashutosh

View solution in original post

32 REPLIES 32

Hi,



Here is your mistake:



PLease paste below code in   script include: DOn't remove default script




var getUserEmail = Class.create();


getUserEmail.prototype = Object.extendsObject(AbstractAjaxProcessor, {


getApp:function(){


var app = this.getParameter('sysparm_app');


var dis;


var gr = new GlideRecord('u_technical_systems'); //Replace cmdb_ci_appl with your table name


gr.addQuery('sys_id',app);


gr.query();


if(gr.next())


{


return gr.u_data_tool_network_location;     //Path should be replaced with you field which contains Path on technical system table


}


},



type: 'getUserEmail'


});




Thank you,


Ashutosh Munot



Please Hit ✅Correct, ��Helpful, or ��Like depending on the impact of the response


Thanks for clarifying,



So the Script Include now successfully saves but it is not working ☹



If I open the record for APA Authoring on the Technical System table and update the u_data_tool_network_location field with data so in this test I have entered 'This is a test'. I save this.



Now on the Service Portal (web portal https://domainname.service-now.com/sp) I open the Cat Item (Requested Item), I select APA Authoring from the Technical System (technical_system) drop down but 'This is a test' is not appearing in the Network Path (network_path) field.



Both the Network Path (network_path) field on the form and the u_data_tool_network_location column on the Technical Systems table are Type = String.



Is this a limitation on the Service Portal (web format)? Will this only work on the Service Management console? Have I missed something?


H Daniel,



Can you do a favor for me. Can you paste whole client script page screen shot as well as Script include.Also table record screen shot.



We are on right path.



Thank you,
Ashutosh Munot


Please see my previous email I have opened up my personal instance to you to see if we can get it right in there. Please be advised that Personal Instance is running Jakarta however my work instance is running Istanbul however I am hoping this will not make much of a difference.



I thought if we can get it up and running on Personal Instance I can then apply to my work DEV Instance.



You are right it does seem like we are very nearly there I really hope we can get this working


Here I have included screen shots of my work dev instance



screen 1 = Script Include


screen 2 = Catalog Client Script


screen 3 = Technical System > You will see the name and the Data Tool Network Location field where I have populated This is a test. This is what should be displaying in the Network Path field on the form


screen 4 = The form on the Service Portal. You can see I have selected APA Authoring however the Network Path is not being called.



Screen 1



Screen 1.jpg


Screen 2


screen 2.jpg


Screen 3


screen 3.jpg



Screen 4


screen 4.jpg