This article is an example of how to create an incremental or change data source for WooCommerce REST API. Steps are similar for other REST API connectors like Magento, BigCommerce, ConnectWise etc. The outcome of this article is to export only new or recently modified WooCommerce orders to Excel.
Note: Steps are identical for SmartConnect.com, except coding needs to be in JavaScript.
Configuration Steps
Create two new Global variables in SmartConnect.
for example, GBL_WOO_ORD_DATE and GBL_WOO_ORD_STAGE_DATE.
Set a default date values in ISO8601-compliant date format (2020-06-15T07:17:39).

Next, go to the Maintenance > WooCommerce REST connector > Data Source tab
- Edit the List all Orders data source.
- Navigate to the Parameters
- Add new parameter key modified_after with value GBL_WOO_ORD_DATE.

Next, create a data source for the List all Orders.
- Data Sources > Bulk > Generic REST Data Source

Then create an integration process using the data source and set the destination Excel export file.

Complete the Mapping destination of the integration.
- You must map at least 1 field to the target.
Switch to the Tasks
- Create a new Run Script task as a Task that runs before the map.
- Write a script to read the current system date, and format the date in the required destination system date format.
- Save the task.
' Get the current date and time Dim currentDate As DateTime = DateTime.Now ' Format the date according to CRM format Dim formattedDate As String = currentDate.ToString("yyyy-MM-ddTHH:mm:ss") & "Z" GBL_WOO_ORD_DATE = formattedDate return true
// Get the current date and time DateTime currentDate = DateTime.UtcNow; // Format the date according to ISO8601 GBL_WOO_ORD_DATE = currentDate.ToString("yyyy-MM-ddTHH:mm:ss") + "Z"; return true;
// Get the current date and time var currentDate = new Date(); // Format the date according to ISO8601 GBL_WOO_ORD_DATE = currentDate.toISOString(); return true;

Add a new Script Task to Tasks that run if the integration succeeds.
- Set the script value to update the GBL_WOO_ORD_DATE variable with the value of the GBL_WOO_ORD_STAGE_DATE
GBL_WOO_ORD_DATE = GBL_WOO_ORD_STAGE_DATE return true
GBL_WOO_ORD_DATE = GBL_WOO_ORD_STAGE_DATE; return true;
GBL_WOO_ORD_DATE = GBL_WOO_ORD_STAGE_DATE; return true;

Next, move to the Variables tab and edit the GBL_WOO_ORD_DATE
- Make sure the Persist Run Value

Conclusion
With these settings configured the integration will capture the date and time the integration run started and save it to a temporary variable. If the integration completes successfully, the value of the temporary variable will be transferred to the variable used in the REST Data Source setup so it can be used as the starting date on the next integration run.