How to Get the Current value from Script Include?

Navin kumar
Tera Contributor

Hi Guys,

  I hope Everyone is fine.

I have an requirement of the reference qualifier to restrict the value of the another field. So I need to get the current value of that field from script include. In which way, we can use current object in Script Include. Kindly help me to do this requirement.

 

Thanks and Regards,

Navinkumar

1 ACCEPTED SOLUTION

Sagar Pagar
Tera Patron

Hi @Navin kumar,

 

You have to pass the current field value as a parameter to Script include and use it in SI for querying records.

For Table Fields  -

javascript: new ScriptInlcudeNAme().functionName(current.field_name, current.field_name1);

 

For Catalog variables -

javascript: new ScriptInlcudeNAme().functionName(current.variables.variable_name1, current.variables.variable_name2);

 

Take a look at old thread -

Call Script include from Reference Qualifier 

Using Advanced Reference Qualification in Catalog Variables 

 

It will help you.

 

Thanks,
Sagar Pagar

The world works with ServiceNow

View solution in original post

3 REPLIES 3

Mohit_Gupta
Tera Guru
Tera Guru

Hi @Navin kumar ,

 

Please follow below link you will get an idea how to pass current object in script include from reference qualifier:-

https://www.servicenow.com/community/developer-forum/how-to-pass-current-record-field-values-in-the-...

I hope this helps 

Please mark my answer correct if this helps you 

Thanks

Mohit

Sagar Pagar
Tera Patron

Hi @Navin kumar,

 

You have to pass the current field value as a parameter to Script include and use it in SI for querying records.

For Table Fields  -

javascript: new ScriptInlcudeNAme().functionName(current.field_name, current.field_name1);

 

For Catalog variables -

javascript: new ScriptInlcudeNAme().functionName(current.variables.variable_name1, current.variables.variable_name2);

 

Take a look at old thread -

Call Script include from Reference Qualifier 

Using Advanced Reference Qualification in Catalog Variables 

 

It will help you.

 

Thanks,
Sagar Pagar

The world works with ServiceNow

Thanks @Sagar Pagar Your answer helped me to do my task thank you so much