Create new records in CRM from JSON data in Blob Storage
If you want to create new records from a json data, you can do it by using Logic App.
First you need to make sure to upload json file in blob container
Steps for Logic App:
- First select a HTTP Trigger block in a new logic app designer
![](https://www.cloudfronts.com/wp-content/uploads/2022/03/image-27.png)
- Next step is to select Get blob content (V2) and choose the storage account name and the blob file where you uploaded the json file.
![](https://www.cloudfronts.com/wp-content/uploads/2022/03/image-33.png)
![](https://www.cloudfronts.com/wp-content/uploads/2022/03/image-32.png)
Note: If you don’t have a connection to Blob Storage account already you need to create one by clicking on change connection and the Add New.
![](https://www.cloudfronts.com/wp-content/uploads/2022/03/image-35.png)
You need to fill the details properly to create a correct connection.
![](https://www.cloudfronts.com/wp-content/uploads/2022/03/image-30.png)
Access Key of the storage account can be found in Storage account in access keys section
![](https://www.cloudfronts.com/wp-content/uploads/2022/03/image-37-1024x712.png)
- Now select Parse Json block to extract all values. Click on use sample payload and paste your payload there to get a schema.
![](https://www.cloudfronts.com/wp-content/uploads/2022/03/image-34.png)
Note: In Content if you directly put File content then you will get error after you run the logic.
Error:
![](https://www.cloudfronts.com/wp-content/uploads/2022/03/image-29.png)
You get this error so for the you need to convert the octet-stream file to json file by writing the following function
json(body(‘Get_blob_content_(V2)’))
![](https://www.cloudfronts.com/wp-content/uploads/2022/03/image-28.png)
- Now once your json is parsed you need to create record in CRM using this data by selecting Create a new record block in CRM.
You need to first sign in with your CRM account and then choose the organization and entity.
Later you need to map the fields.
![](https://www.cloudfronts.com/wp-content/uploads/2022/03/image-36.png)
Note: If there are mulitple records in json then the logic app will automatically take the create new record block in for each block as a step.
![](https://www.cloudfronts.com/wp-content/uploads/2022/03/image-31.png)
Now the records will be created in CRM.
![](https://www.cloudfronts.com/wp-content/uploads/2023/01/BUCHI-Customer-Success-Banner.png)