Step to transform column data in CSV using logic app

Srinivas Mehenderker Nath 86 Reputation points
2023-01-20T09:36:27.32+00:00

I have a CSV file created in the logic app based on a table. I would like to transform the data on certain columns to pre-determined values in the same CSV.

Kindly advise how to implement this step in the logic app.

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

1 answer

Sort by: Most helpful
  1. Deepthi Murali 21 Reputation points
    2023-01-20T10:13:30.1066667+00:00

    Hi,

    This can be done by Create CSV Table action. Create CSV Table action expects its input as JSON array. Please follow the below steps:

    1. Covert input CSV to JSON Array e.g
       [
         {
           "Count": 1,
           "Product": "Apples"
         },
         {
           "Count": 2,
           "Product": "oranges"
         },
         {
           "Count": 5,
           "Product": "Pear"
         }
       ]
    
    1. Add a Create CSV Table action and set From as the JSON Array and Columns : Custom.
    2. For each row, in the expression editor, enter this expression that specifies the array property value that you want, and select OK. item()?['<array-property-name>'] e.g : item()?['Product']
    3. if the column needs to be set to a predetermined value, specify that value ('Fruit' in the below example) User's image
    4. And the output will be as below Apples,1,Fruit oranges,2,Fruit Pear,5,Fruit

Your answer

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