Requirement
Third party Vendor wants to push records in D365 Finance and operation by providing input in a JSON format.
JSON Format:
Purpose
The purpose of the document is to provide all the necessary steps of developing a REST web service in Logic Apps which will accept JSON message as input. Parse of JSON string will happen in Logic Apps & records will inserted into a table of D365 Finance and operation environment using data entities.
Perquisites
- Logic Apps subscription is required
- D365 Finance and operation development environment.
- Documents related to JSON schema and format should be shared with developer
- D365 Data entities should be accessible from outside. In my case I have 2 tables and 2 data entities of both the tables. Tables Name are OrderHeader & OrderLines.
Steps
- Generate the JSON schema by using URL https://jsonschema.net/ using JSON sample
- Create a new Logic Apps from blank template.
- Add a trigger of type “REQUEST” – When a HTTP request is received and paste the JSON schema created in step 1 into the section Request Body JSON Schema
- Add a new step and use the new action of type Data Operation – Parse JSON.
- (In case you require) Add a new step for initializing a variable. I am using here Initialize variable action .I am using it for line number counter later.
- Add a new step by using control – For Each
- Add a new step by using action “Create record”-Dynamics 365 for fin & ops. Provide D365 environment URL , data entity name & credentials. In this example I am using entity OrderHeader.This step should be inside “For Each” loop and we will insert Orderheader data.
- After inserting record into OrderHeader entity , we will fill details by using OrderLine Entity.Flow is mentioned below
- Save your flow
- Copy the HTTP POST URL
- For testing visit website https://apitester.com/
- Records are inserted
cheers
piyush adhikari 🙂
Can we do it without logic apps with just x++ code.