Finding the Right Data Entity

Let’s say you know you want to read data from F&O and OData endpoints are appropriate.  LogicApps is a great way to pull that data and push it to another service.  Or perhaps you subscribed to an F&O Business Event and want additional information about the customer so that you can send an email alert with the customer’s name, credit, and payment terms.

We need to find the correct data entity to use (hint: many times there are multiple).

You could search the AOT directly.

We could also just scroll through the two thousand options within the connector.

Or, we could see what data entities are referenced by the table that stores the data we need in LogicApps.

Key tip: check the “Public Collection” property for the correct URL, if you are going to test with PostMan or use the URL in another integration platform.

The URL for this data entity is https://yourenvironmentaos.cloudax.dynamics.com/data/CustomersV3

Using the Connector

Let’s try the customer account number as the Object ID.  That should work…right?

But we get the following error.  And it doesn’t indicate what field we are missing or how to fix the call.

Debugging Errors with OData Calls

The F&O connector documentation has some great detail on some of the actions that are possible yet lacks information on what exactly to provide for the Object ID parameter when retrieving records.  You may get a message that there are not enough arguments, or perhaps just the record wasn’t found.  Essentially this Object ID is the primary key for the data entity in the order that the Data Entity has it…for demonstration purposes I’ve included the errors below, and a successful call.

Let’s try sending the legal entity along with the customer number, both in quotes.

This is the error received with the above object ID:

We can check the event log on the dev box to see why the call was invalid.

It looks like LogicApps url-encoded the quotation marks on our data parameters.  In other words, the double quotation mark became %2522.  Sending the data without those question marks will work!

Another common error message is 404, which likely means you sent the key data but they were provided in the wrong order:

{ "status": 400, "message": "Only 1 of 2 keys provided for lookup, provide keys for dataAreaId,CustomerAccount.\r\nclientRequestId: 44ede2ab-85b5-4853-832e-6218f77c2c53", "source": "dynamicsax-wus.azconn-wus.p.azurewebsites.net" }

Success!

We change the parameters to DataAreaId,CustAccount and it works.

HTTP 200 status code means a successful call!

So to access the CustomersV3 Entity via the Logic Apps / Flow connector, the Object ID that must be specified is the DataAreaID and CustomerNumber sans quotes.

The normal next step after getting the data is to use the “Parse JSON” action to populate variables with the data for use in the subsequent actions.