The OData provider is a general purpose provider designed to let you import and export data to and from DynamicWeb through the OData protocol using standard REST methods.
Used as a source
When using the OData provider as source, you can choose any OData endpoint defined in Endpoint management as the foundation of your integration.
It is possible to use both single - and multi entitity endpoints for OData activities. The OData provider is built to autodetect if a single entity is specified or not, by checking if the final "/" in the URL is followed by an entity set name. If not, the provider will automatically look up the full metadata page. Examples of single - and multiendpoints:
- Single entity: https://api.businesscentral.dynamics.com/v2.0/myTenantID/MyBC/ODataV4/Company('myCompany')/DynamicwebVendorCard
- Multi entity: https://myCompany.crm4.dynamics.com/api/data/v9.0/
When using the OData provider as source there are three modes to choose from:
By locating the time of the last succesful run this mode will import new records only. No records are deleted from Dynamicweb when this mode is used.
Note: Delta replication converts all Datetime attributes to UTC-time to ensure correct comparison across timezones.
|First page||Imports the first page of records only. The maximum amount of records on a page is specified in the maximum page size setting.|
|Full replication||This mode imports all records and deletes nothing in Dynamicweb. Activities with this mode should only be run once.|
The OData provider as source provider has the additional following parameters:
Used as a destination
The OData provider can be used as a destination provider to export data to a remote system using the OData protocol.
To do so, you must first define a destination endpoint in Endpoint management that exposes the relevant entities.
The OData provider uses custom key columns to detect if the record already exists in the remote system database and if it should POST a new record or PATCH an excisting one.
In some cases, when exporting data via the OData protocol, the remote system may generate a response from which you might wish to stamp fields onto the source objects. For instance, a scenario could be that:
- An activity exports users from Dynamicweb to an external ERP via the OData protocol
- The ERP assigns an auto ID to each user
- The ERP sends a response back to Dynamicweb including these auto ID's
- You want to enrich the user records in the Dynamicweb with the external ID's
In order to stamp informations like these back onto the source, the response mapping functionality of integration activities can be utilized.
To do so, click Response mapping in the activity ribbon bar.
This will take you to a mapping screen similar to the one where you added mappings to the remote system in the first place.
By default, the screen will mirror the table mappings defined in the activity to which you can add the column mappings you wish to establish. Notice that the source columns available are equivalent to the destination columns in the original data mappings screen.
The OData provider supports response mappings only when a POST request method is sent to the external system and not when a PATCH request method is used to update already existing records.