Skip to content
+1-888-319-3663

HELP ARTICLE

Creating an incremental REST API data source


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

1. Create two new Global variables in SmartConnect, for example, GBL_WOO_ORD_DATE and GBL_WOO_ORD_STAGE_DATE. Set a default date value for GBL_WOO_ORD_DATE in the ISO8601-compliant date format (2020-06-15T07:17:39).
2. Next, go to the Maintenance > WooCommerce REST connector > Data Source tab  
a. Edit the List all Orders data source.
b. Navigate to the Parameters
c. Add new parameter key modified_after with value GBL_WOO_ORD_DATE.

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

4. Then create an integration process using the data source and set the destination Excel export file.
Note: This process will work with any destination you choose.

5. Complete the Mapping destination of the integration.
a. You must map at least 1 field to the target.
6. Switch to the Tasks
a. Create a new Run Script task as a Task that runs before the map.
b. Write a script to read the current system date, and format the date in the required destination system date format. For this example, I have formatted the date according to the required  ISO8601-compliant date format
c. Save the task.
7. Add a new Script Task to Tasks that run if the integration succeeds
a. Set the script value to update the GBL_WOO_ORD_DATE variable with the value of the GBL_WOO_ORD_STAGE_DATE

8. Next, move to the Variables tab and edit the GBL_WOO_ORD_DATE
a. Make sure the Persist Run Value
1. With this option set the value saved at the end of the map run will be used on the next run.


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.

RECENT POSTS


Configuring Salesforce Integration User
Business Central Extension Publish Error
Re-registering a Change Data Source in Business Central on SmartConnect.com
Moving SmartConnect 21 to a new server
eConnect error 4628 - The Tracking Number (Tracking_Number) is empty

POPULAR POSTS


SSL Security error using OLEDB Connection
This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms
Removed Part: /xl/vbaProject.bin part. (Visual Basic for Applications (VBA))
The server process could not be started because the configured identity is incorrect.
Using WINSCP and a task to upload or download files from an SFTP site

CATEGORIES

TAGS

Business Central CRM D365 Business Central Dynamics 365 dynamics crm Dynamics GP Dynamics NAV Econnect Employee Spotlight eone eOne News error Error Message Events Excel Excel Report Builder Extender Flexicoder GP integration Map Microsoft dynamics crm Microsoft Dynamics GP Navigation List Builder Office Relationships Partner All Hands Call Popdock promotions release Salesforce Salesforce.com SmartConnect SmartConnect.com SmartConnect Bootcamp SmartConnect Maps SmartConnect Office Hours SmartList SmartList Builder SmartPost SmartView SQL Tech Tuesday Templates training Zendesk

Integrate & Automate without Any Code.

SmartList Data has Never Been Faster.

The Easiest Way to Report on GP Data.