Before subscribe scripts
A Before subcsribe script in Perspectium DataSync Express allows the current record that is being subscribed to be processed after it is loaded into a GlideRecord, but before it is saved into the target table in ServiceNow. Before subscribe scripts expect server side javascript and is preconfigured with a globally available variable called current that is the GlideRecord object that is going to be subscribed into the target table.
After subscribe scripts
An After subscribe script allows you to specify a script that will run after your subscribe has saved the record into the target table. This can be useful for when you want to do some additional processing after your subscribe has run.
NOTE: Changing any values in a variable in the After subscribe script will not update and save the value (i.e. setting current.short_description = "test" will not actually update the short_description value in the target incident table) since the After subscribe script is used for reference or to do other actions.
Prerequisites
First, you will need to get started with DataSync Express.
Procedure
To create before/after subscribe scripts, follow these steps:
Create a new Subscribe
Log into your ServiceNow instance and navigate to Perspectium DataSync Express > DataSync Express > Subscribe > New to create a new subscribe.
Type your Before/After subscribescript
For both Before share script and After share script options, go to the Scripting tab. Then, type your before subscribe script or after subscribe script in the associated scripting window with the following variables available for you to use.
Click Update
Near the bottom left-hand corner of the form (just above Related Links), click Update to save the changes to your dynamic share.