Change the <tenant> to the tenant where your app is registered and the <org> will refer to your Dynamics Environment URL, you will also have one of these if you are not using Dynamics and just using the Dataverse tables.
Click Connect in the Connection and you should see a Connection Established and the connection is ready to be used!
Create a Data Source
Data Sources in TrueContext are created using the HTTP GET Data Source. The Web API employs the OData protocol to interface with tables in Dataverse, allowing us to use the same OData functionality across any table in Dynamics/Dataverse.
When initially building your data sources, it is highly recommended to experiment with them in Postman or Insomnia before integrating them into TrueContext.
The primary consideration should be identifying the necessary information for your form. Your data sources should not include all columns from a particular entity.
The endpoints for retrieving data are consistent across all entities. There are two main methods to find the entity name:
-
Open Dynamics in your browser, navigate to the desired entity, and examine the URL. The parameter 'etn=' in the URL shows the entity name. Note that some names are more intuitive than others (e.g., 'contact' for Contact, but 'incident' for Case), so always verify the URL.
-
With OData, you can use the $select parameter to retrieve only the specific columns needed. This will be included in the Query-String Arguments in TrueContext.
In this example, I am going to GET all the contacts from Dynamics (using the connection we created in the earlier step)
-
URL Path: api/data/v9.2/contacts (contacts can be changed to whatever entity you would like to pull)
-
Query String Arguments (this is where you can define OData Arguments to refine your GET)
Key: $select
Value: emailaddress1,address1_composite,yomifullname,contactid,jobtitle,_parentcustomerid_value,mobilephone
-
Click Save at the bottom and the Data Source should go out and fetch all the specified data
In the next post, I am going to cover writing all the collected data back into Dynamics, both with a regular POST call and how we can use the $batch endpoint to accommodate more complex workflows all in a single request using FreeMarker. If you've done any integrations with Dataverse/Dynamics before, let us know how that went for you and if you found any cool tips and tricks along the way!
#TechTalkImplementation #Dynamics365 #Microsoft