On this Page
Table of Contents | ||||
---|---|---|---|---|
|
Overview
This Snap calls the MS Dynamics 365 For Sales REST WebAPI endpoint using the incoming data and writes out a JSON response.
ETL Transformations & Data Flow
This Snap enables the following ETL operations or flows:
- Extract data from the upstream Snap containing the data for performing the provided action on the MS Dynamics 365 For Sales object(s).
- Transform the input document into a SnapLogic-friendly JSON Document.
- Load the data into the Dynamics 365 For Sales Execute Snap to perform the operation on the MS Dynamics 365 For Sales object(s).
Input & Output
Expected upstream Snaps: Any Snap, such as a Mapper or JSON Generator Snap, that offers a document as output.
Expected downstream Snaps: None.
Expected Input: The mandatory fields required for executing the concerned operation on the MS Dynamics 365 For Sales object(s).
- Expected Output: A document with the result set. If the operation is successful, then the output document will contain the information on the MS Dynamics 365 For Sales object(s) being operated.
Prerequisites
You must have a Dynamics 365 OAuth2 for Online account, data to query, and access to the objects concerned.
Configuring Accounts
This Snap uses account references created on the Accounts page of SnapLogic Manager to handle access to this endpoint. See Configuring Dynamics 365 for Sales AccountAccounts for information on setting up this type of account.
Configuring Views
Input | This Snap has exactly one document input view. |
---|---|
Output | This Snap has exactly one document output view. |
Error | This Snap has at most one document error view. |
Troubleshooting
To check whether an operation has completed as expected, perform the same operation directly on the user interface or by sending the appropriate JSON request to the MS Dynamics 365 For Sales WebAPI endpoint. Use Postman (version 6.0.10 minimum) and collect the necessary data. To see if there are any inconsistencies, compare the data used in the user interface or Soap UI with the SnapLogic pipelines.
Support
- Works in Ultra Task Pipelines.
Known Issues
- The Execute Snap currently does not fetch schema. Currently, the user is expected to completely craft the upstream request body.
Snap Settings
Label | Required. The name for the Snap. Modify this to be more specific, especially if there are more than one of the same Snap in the pipeline. | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Dynamics Organization URL | Required. The URL for the MS Dynamics 365 For Sales WebAPI endpoint. Although the URL is editable, query parameters should not be placed within the URL, as that will not work with the supporting libraries. The Query Parameter fields must be explicitly-used query parameter values, such as search filters, etc. This field is suggestible, and shows the user's currently configured Account URL. The REST resource, etc. can be then crafted onto the resulting URL. Example: https://abcxyzcompany.api.crm.dynamics.com/api/data/v8.2/ Example: https://abcxyzcompany.api.crm.dynamics.com/api/data/v8.2/accounts(GUID) (For example, in a GET request of a specific account) Default value: https://<organization>/api/data/<version>/<api> | |||||||||||||
Object type | Enables you to specify the MS Dynamics 365 for Sales object type to allow its schema to be fetched by the Snap. Custom object types are currently not supported. Default value: account | |||||||||||||
HTTP Method | Required. The HTTP REST Method that will be used in the request. Example: GET, POST, PUT, PATCH, DELETE Default value: GET | |||||||||||||
HTTP Request Body | The request body can be directly input into this field for write actions, such as POST or PATCH; however, this field is not required for actions such as GET or DELETE. If the request body is input directly into this field, it must be in the form of a JSON String. Note that the double quotes in the String need to be "Java escaped". Typically the request body will be provided by an upstream Snap such as a Mapper Snap or JSON Generator Snap. Therefore, the field is defaulted to being expression enabled, and the expression is set to "$" which represents the JSON body provided by the upstream Snap. Example:
Default value: $ | |||||||||||||
Query Parameters | Use the Query Parameters field-set to define search query parameters and their values. The query parameters will be attached to the URL using the HTTP query parameter syntax, separated by '&' and added as key=value. | |||||||||||||
HTTP header | Additional HTTP headers to pass when sending requests to the Dynamics 365 for Sales instance. Example:
Default value: No default value | |||||||||||||
Parameter | Enter here the attribute that would be used as a key in your query. Example: $filter: A value of $filter is typically used as part of a GET request. For example, the user may want to GET Account objects where a given filter condition exists. Microsoft Dynamics 365 provides a number of special functions that accept parameters, return Boolean values, and can be used as filter criteria in a query. For a list of these functions, see Microsoft Web API Query Function Reference The following is an example of the Between Function searching for accounts with a number of employees between 5 and 2000:
| |||||||||||||
Value | Specify the value associated with the parameter chosen in the Parameter field in the Query Parameters field-set. For example, if the Parameter was $filter, the value could be '"name eq 'Microsoft' or 'revenue gt 100' or "address1_fax eq '1234567'".
Microsoft has provided the following documentation on the filtering functionality: | |||||||||||||
|
|
Examples
Using Dynamics 365 for Sales Execute as a Standalone Snap
Basic use case: Retrieving an organization's account information
Expand | ||
---|---|---|
| ||
This pipeline demonstrates how the Execute Snap functions as a standalone Snap in a pipeline. In this example, we shall retrieve all the Accounts present in the MS Dynamics 365 For Sales Org: The Execute Snap's configuration is the following: |
Using Upstream Snaps with the Execute Snap
Basic Use Case: Creating an account using the Execute Snap
Expand | ||
---|---|---|
| ||
The following pipeline demonstrates how you can use the Execute Snap to create an Account. In this example, we have used a JSON Generator Snap to capture the details we want to use to create an account. This is the JSON document provided by the generator: We now add an Execute Snap downstream to the JSON Generator. Two configurations to be made here:
Save and close the Snap Settings popup and execute the pipeline. For a successful execution, you should see JSON output similar to the one shown below: |
Advanced Use Case: Querying an account using query parameters within the Execute Snap
Expand | ||
---|---|---|
| ||
The following pipeline demonstrates how you can implement a filter the Execute Snap's query parameters to retrieve a specific Account. In this example, we have used a Mapper Snap to pass the value we are searching for into the name variable. Now we craft the query parameter key and value pair in the Execute Snap. Note: In order to follow MS Dynamics 365 For Sales guidelines, we have to surround our "$name" variable with single quotes. This is because the "$name" variable is going to be evaluated by Microsoft as a string of characters. If we had been evaluating a numeric value such as a dollar amount, we would not surround the variable in single quotes. Note that there are some values that are entirely full of numeric characters, but are in fact strings (phone numbers, fax numbers, etc). Microsoft has provided the following detailed information regarding the use of "$filter" queries : Dynamics Docs > Query Data using the Web API > Filter results. Now we see that we were able to successfully execute the request, and have indeed retrieved the account with the specified "$name" variable: |
Downloads
Attachments | ||||||
---|---|---|---|---|---|---|
|
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|