The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Is there a way to set some value to scratchpad in the script include and pass the same to business rule

lingamgunta_mah
Kilo Contributor

Hi,

Is there a way to add some value to scratchpad variable in the script include and pass the same scratchpad to business rule like we have the display business rule to retrieve the database value using g_scratchpad and pass it same in the client script.

Thanks,

Mahesh.

5 REPLIES 5

Mike Moody
Kilo Guru

Hi Mahesh,



The only way I can think of accomplishing this is to create a workflow context when your target record is created, and complete the workflow once all work has been completed with the record. Then what you could do is leverage the scratchpad in the running workflow context to pass data back and forth between Script Includes and Business Rules running against that same record.



Take a look at this: Accessing the Workflow Scratchpad from Business Rules - ServiceNow Wiki



You should be able to use that same approach to access the scratchpad from a Script Include if you have access to current.