1

Is it possible to convert CSV to JSON using built-in/managed/3rd party template, without using Azure Function via Azure Logic App?

Below is using Azure Function, which is generated automaticately. However, I cannot find the link like what it mentions. Ideally, no Azure function is required.

http://blogs.recneps.org/post/Processing-a-flat-file-with-Azure-Logic-Apps

https://social.msdn.microsoft.com/Forums/en-US/e0ea1adc-1979-44df-a4d1-52290338bc78/transform-csv-in-logic-app?forum=azurelogicapps

Below, No CSV to JSON available.

https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-enterprise-integration-liquid-transform

Pingpong
  • 7,681
  • 21
  • 83
  • 209
  • have a look at this article: https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-add-run-inline-code – Thomas Jun 15 '19 at 08:07
  • Some limitations at the moment, e.g. *Runs in JavaScript.*Finishes running in five seconds or fewer. *Handles data up to 50 MB in size. Ideally with support for C# – Pingpong Jun 16 '19 at 01:02

1 Answers1

3

I will admit this is not my proudest work but it seems to work fairly well. I was able to turn a CSV file from my onedrive into JSON objects.

//Updated with less variables, splits, set and replaces actions

Input

Input

Output(second object, first object and last needs to be purged) Output

How? A lot of steps that could possibly be removed and merged but. Using splits and replace actions I could single out each line and down the line create a JSON object. I was going first for an array but eventually, it was not that hard to make it into a JSON object. Not entirely sure how it works with null values.

This is probably not the best way to handle this, drawbacks here is that it is a lot of actions, the first object is the headers and that needs to be removed, there will also be a very last object that is just null(which is fine).

Entire schema

Variables

Concurrency set to 1 here For each row For each item on row

AdAstra
  • 1,934
  • 11
  • 9
  • Hey @AdAstra could you please retype the split and replace expressions once again? It isn't clear in the screenshot. Thanks – SD4 Nov 04 '20 at 10:55