I am new to LogicApps. I have below scenario to implement.
I have a scenario where I have to convert CSV data to JSON using standard LogicApps. I have to pick the CSV file from Azure File share and convert it to JSON, and store the JSON file to Azure Fileshare. Can someone help me with the steps to achieve this?
Below is Input CSV and Expected Output
Input CSV Data
CustomerName,OrderID,Orderdate,ItemNumer,ItemPrice
Rahul,ORD123,18-01-2024,ITM001,150.00
Rahul,ORD133,18-01-2024,ITM002,200.00
Rajib,ORD234,18-01-2024,ITM123,100.00
Rahul,ORD123,18-01-2024,ITM003,250.00
Rajib,ORD234,18-01-2024,ITM125,500.00
Rahul,ORD133,18-01-2024,ITM004,300.00
Expected JSON Output Data:
{
"orderdetails": [
{
"customername": "Rahul",
"orders": [
{
"OrderID": "ORD123",
"Orderdate": "18-01-2024",
"Itemdetails": [
{
"itemnumber": "ITM001",
"itemprice": "150.00"
},
{
"itemnumber": "ITM003",
"itemprice": "250.00"
}
]
},
{
"OrderID": "ORD133",
"Orderdate": "18-01-2024",
"Itemdetails": [
{
"itemnumber": "ITM002",
"itemprice": "200.00"
},
{
"itemnumber": "ITM004",
"itemprice": "300.00"
}
]
}
]
},
{
"customername": "Rajib",
"orders": [
{
"OrderID": "ORD234",
"Orderdate": "18-01-2024",
"Itemdetails": [
{
"itemnumber": "ITM123",
"itemprice": "100.00"
},
{
"itemnumber": "ITM125",
"itemprice": "500.00"
}
]
}
]
}
]
}
Any help with the steps is appreciated.
Below is then
designwhich will work in Consumption and Standard Logic apps too and provided expected results:Compose : -
split(body('Get_file_content'),decodeUriComponent('%0D%0A'))Compose 2:
split(first(outputs('Compose')), ',')Select action:
(@ has come while copying it)
Output: