{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["tabs","tab"]},"redocly_category":"Integrations","type":"markdown"},"seo":{"title":"Microsoft Dynamics 365 Sales Import Integration","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"microsoft-dynamics-365-sales-import-integration","__idx":0},"children":["Microsoft Dynamics 365 Sales Import Integration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This Treasure Data integration empowers digital sales organizations with modern remote collaboration capabilities for exceptional teamwork and frictionless engagement:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Find and build stronger relationships."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Improve productivity and performance."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Get a single view of customers."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The import integration allows you to ingest contact and transactional data (including quotes and sales orders) from MS Dynamics 365 to Treasure Data."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"prerequisites","__idx":1},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Basic Knowledge of Treasure Data."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Client Credentials authentication"]},": Administration privileges to access Azure Active Directory and Dynamics CRM Security settings."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["OAuth authentication"]},": A tenant administrator or a user with access to Azure \"Enterprise applications\" to grant consent."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"about-incremental-data-loading","__idx":2},"children":["About Incremental Data Loading"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["When incremental loading is enabled, the query issued to Dynamics API contains the statements $filter and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$orderby."]}," The $filter queries data for desired criteria, and $orderby sorts data in a descending manner"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The first value received will be kept as a reference for the next job filter. The following job $filter excludes previous job data and fetches new data only."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The process repeats for subsequence execution."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2021-4-6_18-43-24.86d03abace4ca184c72b6857a6cc454f40bca56d8884edae922267e2da2e50bd.62ce3a79.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["When incremental loading is enabled, the End Time is left blank (by default, it will be set to the current time)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The filter column (by default ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["modifiedon"]}]},{"$$mdtype":"Tag","name":"code","attributes":{},"children":[") must not contain a null or empty value."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example","__idx":3},"children":["Example"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following is an example of when incremental loading is enabled:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Assumption/condition",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Start Time = 2021-01-01T00:03:01Z"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Job scheduled to run daily"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["1st  job current time = 2021-01-15T00:03:01Z:  $filter=",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["modifiedon"]}]}," > 2021-01-01T00:03:01Z and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["modifiedon"]}]},{"$$mdtype":"Tag","name":"code","attributes":{},"children":["<= 2021-01-15T00:03:01Z, $orderby = modifiedon desc. First record result has modifiedon = 2021-01-10T00:00:00Z"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2nd job current time = 2021-01-16T00:03:01Z:"]}," $filter=",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["modifiedon"]}]}," > ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2021-01-10T00:00:00Z"]}," and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["modifiedon"]}]},{"$$mdtype":"Tag","name":"code","attributes":{},"children":["<= 2021-01-16T00:03:01Z, $orderby = modifiedon desc. First record result has modifiedon = 2021-01-16T00:03:01Z"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["3rd job current time = 2021-01-17T00:03:01Z:"]},"$filter=",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["modifiedon"]}]}," > ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2021-01-16T00:03:01Z"]}," and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["modifiedon"]}]},{"$$mdtype":"Tag","name":"code","attributes":{},"children":["<= 2021-01-17T00:03:01Z, $orderby = modifiedon desc. First record result has modifiedon = 2021-01-17T00:00:01Z"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["..."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"obtaining-client-id-and-client-secret","__idx":4},"children":["Obtaining Client ID and Client Secret"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["These values are necessary to connect using the Client Credentials authentication option. They are optional if you expect to use the OAuth option to authenticate."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Follow the Microsoft documentation to create your client application and get your client ID and client secret:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.microsoft.com/en-us/powerapps/developer/data-platform/use-single-tenant-server-server-authentication#azure-application-registration"},"children":["https://docs.microsoft.com/en-us/powerapps/developer/data-platform/use-single-tenant-server-server-authentication#azure-application-registration"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You should create a custom security role with minimal permission for your registered application. See:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://learn.microsoft.com/en-us/previous-versions/dynamicscrm-2016/administering-dynamics-365/dn531130(v=crm.8)"},"children":["https://learn.microsoft.com/en-us/previous-versions/dynamicscrm-2016/administering-dynamics-365/dn531130(v=crm.8)"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://learn.microsoft.com/en-us/previous-versions/dynamicscrm-2016/administering-dynamics-365/dn531090(v=crm.8)"},"children":["https://learn.microsoft.com/en-us/previous-versions/dynamicscrm-2016/administering-dynamics-365/dn531090(v=crm.8)"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"entity-type","__idx":5},"children":["Entity Type"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can fetch all available entities by importing:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Entity Type = entity"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Filter Column = overwritetime"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Start Time = 1800-06-21T00:00:00Z"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/authentications-treasure-data.11a13b5b370adaac27023746f9b19c3899fcc425e67242f9e44738ae25d70096.62ce3a79.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Although this integration supports almost all entities by generic configuration settings if you notice entities that may require specific settings, contact support."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"use-the-treasure-console-to-create-your-connection","__idx":6},"children":["Use the Treasure Console to Create Your Connection"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"create-a-new-connection","__idx":7},"children":["Create a New Connection"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You must create and configure the data connection in Treasure Data before running your query. As part of the data connection, you provide authentication to access the integration."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Open ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Treasure Console"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Integrations Hub"]}," >  ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Catalog"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Search for and select Microsoft Dynamic 365 Sales."]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2021-3-26_13-56-23.c5debb8998238c05f8dc6b4920bfe1043fc3a53e8c1fa3d2fcf7dee26f513349.62ce3a79.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":4},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create Authentication"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2021-3-26_14-1-13.6ed67e7220d4eb7c2f166835f08a39f5b1c49cbe7956d269234c12f2ba8ae6bd.62ce3a79.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":5},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Type your MS Dynamics domain name."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Choose one of the following authentication methods:"]}]}]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"label":"OAuth Authentication","disable":false},"children":[{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select OAuth. ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2021-3-26_14-1-13.6ed67e7220d4eb7c2f166835f08a39f5b1c49cbe7956d269234c12f2ba8ae6bd.62ce3a79.png","alt":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Type the credentials to authenticate."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Optionally, select Click here and log in to Microsoft Dynamics 365 to grant consent."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Return ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Integrations Hub"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Catalog"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Search for and select Microsoft Dynamics 365 Sales."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Type the value of your Domain"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select OAuth Authentication Method."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select your newly created OAuth connection"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Review the OAuth connection field definition."]}]}]}]},{"$$mdtype":"Tag","name":"div","attributes":{"label":"Client Credentials Authentication","disable":false},"children":[{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select Client Credentials."," ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2021-3-26_14-3-59.8516ff9981b8c29ab4c044f3acd5271febeb25c7a31a6c4f9e8f5d5c79d4008e.62ce3a79.png","alt":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Type the value of your Domain"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Type the value of your Tenant ID."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Type the value of your Client ID."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Type your Client Secret."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Continue."]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Enter a name for your connection."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Continue."]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"transfer-your-data-to-treasure-data","__idx":8},"children":["Transfer Your Data to Treasure Data"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After creating the authenticated connection, you are automatically taken to Authentications."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Search for the connection you created."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New Source"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Type a name for your ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Source"]}," in the Data Transfer field**.**"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2021-3-26_14-55-0.59c9d050df7b5bee98615094570021ed08c011d22bd2c520815b92732a05ee55.62ce3a79.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":4},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Next"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Source Table dialog opens."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/microsof_365_kaizen.35a80e764a9361f72471206d38bdfe3f1248a148a24cc3fce904744a7d9fc368.62ce3a79.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Edit the following parameters:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameters"},"children":["Parameters"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Required"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Entity Type"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Entity logical name E.g. contact, sales_order, account...use ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/int/microsoft-dynamics-365-sales-import-integration"},"children":["fetch Entity Type"]}," to fetch all available entities"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Filter Column"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Column to filter data (support date time column only)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Start Time"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["In UTC format YYYY-MM-DDThh:mm:ssZ. Import data modified from this timestamp.   - The Start Time field is exclusive, which means it won’t download data equal to this value. If you want data equals to this value being included, set the time earlier 1 second (while the End Time is inclusive)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["End Time"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["This field is optional, If not specified current time will be used. In UTC format YYYY-MM-DDThh:mm:ssZ. Import data modified from this timestamp.  It's recommended to leave this field blank when Incremental loading is enabled."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Custom Expression Filter"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["- A text area where you can enter custom filter expressions to refine your data import - This filter will be combined with the time-based filter using AND operator - Leave empty if you only need time-based filtering - Please refer the the section \"Building Custom Filter Expressions\" below for more details on how to formulate the custom filter expression"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Incremental Loading?"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["If enabled, only import new data from the last ingestion."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Skip Invalid Data?"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["When a column data type can not convert to a known value, the row will be skipped.  If more than 30% of processed rows are invalid, the job stops with a status of fail."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"building-customfilter-expressions","__idx":9},"children":["Building Custom Filter Expressions"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Basic Syntax"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Custom filter expressions consist of:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Field names (e.g., revenue, classification, status)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Operators (e.g., eq, ne, gt)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Values (must be properly formatted based on data type)"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Operators"]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Comparison Operators"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eq"]}," - Equal to: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status eq 'active'"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ne"]}," - Not equal to: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["classification ne 'confidential'"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["gt"]}," - Greater than: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["revenue gt 1000000"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ge"]}," - Greater than or equal: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["priority ge 2"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lt"]}," - Less than: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["completion lt 100"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["le"]}," - Less than or equal: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["risk_level le 3"]}]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Logical Operators"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["and"]}," - Both conditions must be true: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status eq 'active' and revenue gt 1000000"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["or"]}," - Either condition can be true: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type eq 'commercial' or type eq 'residential'"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["not"]}," - Negates the condition: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["not (classification eq 'confidential')"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Value Formatting"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Text: Single quotes - ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'active'"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'confidential'"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Numbers: No quotes - ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1000000"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2.5"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Dates: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["datetime'2024-01-08T00:00:00Z'"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["GUIDs: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["guid'12345678-1234-1234-1234-123456789012'"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Functions"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["startswith(fieldname, 'value')"]}," - Checks if the field starts with value"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["endswith(fieldname, 'value')"]}," - Checks if the field ends with value"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["substringof('value', fieldname)"]}," - Checks if the field contains value"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"examples","__idx":10},"children":["Examples"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Basic Filter"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"revenue gt 1000000 and status eq 'active\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Complex Filter"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"(classification ne 'confidential' and building_type ne 'government') or 'security_level eq 'public' and revenue gt 5000000)\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Using Functions"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"not (startswith(customer_name, 'Gov')) and not (substringof('classified', description))\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"_","__idx":11},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Best Practices"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Test your filter using Dynamics 365's API before using it in the import"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Start with simple conditions and build up complexity"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use parentheses to group conditions clearly"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Validate that field names match precisely with Dynamics 365 system's field name"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Field names are case-sensitive"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Text values must be in single quotes"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Date values must be in the correct UTC format"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"data-settings","__idx":12},"children":["Data Settings"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Data Settings page can be modified to fit your needs, or you can skip the page."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2021-3-26_15-2-54.a276cd1e577429c636980498d360be3f14fc315570f86dede412a82ac0382d02.62ce3a79.png","alt":""},"children":[]},{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2021-3-26_15-3-14.190b1c9bfdd3941e6d7ff8c6c6a32e3bc320b55fd80ef338187d673865dcef94.62ce3a79.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Optionally, edit the following parameters:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Required"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Retry Limit"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Maximum retry times for each API call."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Initial retry time wait in millis"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Wait time for the first retry (in milliseconds)."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Max retry wait in mills"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Maximum wait time for an API call before it gives up."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["HTTP Connect Timeout"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The amount of time before the connection times out when making API calls."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["HTTP Read Timeout"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The amount of time waiting to write data into the request."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Column Settings"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["You can remove a column from the result or define its data type.    Do not update the column name because it results in a null value for that column."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]}]}]}]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":8},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Next"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"data-preview","__idx":13},"children":["Data Preview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can see a ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/integration-hub/batch/import/previewing-your-source-data"},"children":["preview"]}," of your data before running the import by selecting Generate Preview. Data preview is optional and you can safely skip to the next page of the dialog if you choose to."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Next"]},". The Data Preview page opens."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["If you want to preview your data, select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Generate Preview"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify the data."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"data-placement","__idx":14},"children":["Data Placement"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For data placement, select the target database and table where you want your data placed and indicate how often the import should run."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Next."]}," Under Storage, you will create a new or select an existing database and create a new or select an existing table for where you want to place the imported data."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Database"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Select an existing"]}," or ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create New Database"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Optionally, type a database name."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Table"]},"> ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Select an existing"]}," or ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create New Table"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Optionally, type a table name."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Choose the method for importing the data."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Append"]}," (default)-Data import results are appended to the table."," ","If the table does not exist, it will be created."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Always Replace"]},"-Replaces the entire content of an existing table with the result output of the query. If the table does not exist, a new table is created."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Replace on New Data"]},"-Only replace the entire content of an existing table with the result output when there is new data."]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Timestamp-based Partition Key"]}," column."," ","If you want to set a different partition key seed than the default key, you can specify the long or timestamp column as the partitioning time. As a default time column, it uses upload_time with the add_time filter."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Timezone"]}," for your data storage."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Schedule"]},", you can choose when and how often you want to run this query."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"run-once","__idx":15},"children":["Run once"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Off"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Scheduling Timezone"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create & Run Now"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"repeat-regularly","__idx":16},"children":["Repeat Regularly"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["On"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Schedule"]},". The UI provides these four options: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["@hourly"]},", ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["@daily"]}," and ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["@monthly"]}," or custom ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["cron"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["You can also select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Delay Transfer"]}," and add a delay of execution time."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Scheduling Timezone"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create & Run Now"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After your transfer has run, you can see the results of your transfer in ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Data Workbench"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Databases."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"import-from-ms-dynamics-365-sales-via-workflow","__idx":17},"children":["Import from MS Dynamics 365 Sales via Workflow"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can import data from MS Dynamics 365 Sale using td_load>: operator of workflow. If you have already created a SOURCE, you can run it"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Identify your source."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To obtain a unique ID, open the Source list and then filter by MS Dynamics 365 Sales."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Open the menu and select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Copy Unique ID"]},"."]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2021-10-12_12-26-58.09d9b84b0f1f752c7c95b0bc1c2d8e8b7302e5b91c6a3cb5f01309dadf53a604.62ce3a79.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":4},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Define a workflow task using td_load> operator."]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"+load:\n  td_load>: unique_id_of_your_source\n  database: ${td.dest_db}\n  table: ${td.dest_table}\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":5},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Run a workflow."]}]}]},"headings":[{"value":"Microsoft Dynamics 365 Sales Import Integration","id":"microsoft-dynamics-365-sales-import-integration","depth":1},{"value":"Prerequisites","id":"prerequisites","depth":2},{"value":"About Incremental Data Loading","id":"about-incremental-data-loading","depth":2},{"value":"Example","id":"example","depth":3},{"value":"Obtaining Client ID and Client Secret","id":"obtaining-client-id-and-client-secret","depth":2},{"value":"Entity Type","id":"entity-type","depth":2},{"value":"Use the Treasure Console to Create Your Connection","id":"use-the-treasure-console-to-create-your-connection","depth":1},{"value":"Create a New Connection","id":"create-a-new-connection","depth":2},{"value":"Transfer Your Data to Treasure Data","id":"transfer-your-data-to-treasure-data","depth":2},{"value":"Building Custom Filter Expressions","id":"building-customfilter-expressions","depth":2},{"value":"Examples","id":"examples","depth":4},{"value":"","id":"_","depth":3},{"value":"Data Settings","id":"data-settings","depth":3},{"value":"Data Preview","id":"data-preview","depth":3},{"value":"Data Placement","id":"data-placement","depth":3},{"value":"Run once","id":"run-once","depth":4},{"value":"Repeat Regularly","id":"repeat-regularly","depth":4},{"value":"Import from MS Dynamics 365 Sales via Workflow","id":"import-from-ms-dynamics-365-sales-via-workflow","depth":1}],"frontmatter":{"seo":{"title":"Microsoft Dynamics 365 Sales Import Integration"}},"lastModified":"2026-06-01T09:09:59.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/int/microsoft-dynamics-365-sales-import-integration","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}