Convert JSON output into CSV table in logic apps

Narendra U 0 Reputation points
2023-04-27T13:39:40.44+00:00

Hello I'm trying to execute below workflow but not able to achieve it

  1. I'm getting data from HTTP action in the form of JSON
  2. I need to achieve it to CSV form.

The Data Sample is attached below

{
  "data": {
    "Event1": {
      "Action": "Log in",
      "Data": "Master Vault",
      "IP_Address": "1.1.1.1",
      "Time": "2023-04-18 03:51:32",
      "Username": "Sam"
    },
    "Event2": {
      "Action": "Log in",
      "Data": "Master Vault",
      "IP_Address": "2.2.2.2",
      "Time": "2023-04-18 03:35:06",
      "Username": "John"
    },
    "Event3": {
      "Action": "Log in",
      "Data": "dext",
      "IP_Address": "3.3.3.3",
      "Time": "2023-04-18 03:34:46",
      "Username": "Rizwan"
    },
    "Event4": {
      "Action": "Log in",
      "Data": "google.com",
      "IP_Address": "4.4.4.4",
      "Time": "2023-04-18 03:34:08",
      "Username": "Prachi"
    }
  }
} 

I tried to implement using variable but no progress, please let me know any working solution

User's image

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,133 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Dillon Silzer 57,481 Reputation points
    2023-04-27T17:34:42.1433333+00:00

    Hi Narenda,

    You can use the Compose function to change the inputs from your Parse JSON and change it into CSV format:

    (See Beefcake's response)

    https://stackoverflow.com/questions/48923628/logic-app-create-csv-table-from-json-output

    Create_CSV_table": {
                "inputs": {
                    "format": "CSV",
                    "from": "@json(outputs('Parse JSON 2'))"
                },
    

    You should then see your output as a CSV response. Let me know what you get for an output if you are having issues.


    If this is helpful please accept answer.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.