Using a payload-level custom script in services
Introduction
This page explains how to associate a payload-level custom script with a service, then run the service and check input and output payloads.
If this is the first time you are using this script, you are strongly advised to work with a test service and ensure everything syncs as expected before applying to live services.
In Patchworks, a test service can be created by defining test (rather than live) source and destination connectors which point to sandbox URLs for the associated systems.
Associating a payload-level script with a service
Step 1
Use the services option to access an existing service that you'd like to update, or add a new service:
Step 2 If at least one payload-level custom script has been added, a payload script tab is available - select it:

Step 3 Click the select custom script field and choose the script that you wish to associate with this service - for example:

Step 4 Details for the selected script are displayed:

You don't need to do anything here - everything is ready to go. However, if you wish to update the script, click the modify this script button to edit the script in the manage custom scripts area.
Step 5 Use the add script to service button to apply changes.
Running the service & checking payloads
Step 1 Select the run service tab:

Step 2 Scroll down to the service options section and toggle on the store custom script payloads setting:

Step 3 Set all other options as required and run the service:

Step 4 As the service runs, custom script activity is displayed in the the custom scripts logs section of the service log - for example:

Step 5 When the service run is complete and you opted to download custom script payloads, you can download these files using buttons in the custom script payload panel:
