Insert in SQL Server from CSV File in Power Automate

Javier Guzman 81 Reputation points
2022-11-03T16:35:13.823+00:00

Hi Group

@MayankBargali-MSFT \ @Bruno Lucas

As we all know the "insert rows" (SQL SERVER) object is insert line by line and is so slow. I created CSV table already with all the data.

The next step would be to separate each field to map it to insert .
But I have a problem separating the fields of the CSV creation

256844-image.png

Thanks so much for your help.

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

Accepted answer
  1. Bruno Lucas 4,216 Reputation points MVP
    2022-11-03T21:30:11.017+00:00

    Hi @Javier Guzman

    If you add this logic:

    257031-image.png

    You can proceed to use the json parse when it succeeds
    256964-image.png

    When the Parse Json succeed, the fields will be already split by the json parser task
    257032-image.png

    Follow Up after comment:

    Looking on your flow, where is the 'OutPutArray' we see in #3 coming from? #1 or #2?

    257036-image.png

    You may have those values easier to access back in the flow.

    But Considering the Array "OutPutArray" passed to "Create CSV table" has the same values as the generated CSV
    you can pick the filters like this:

    variables('OutputArray')[0]['FieldName']

    Can you share what is in the script you are passing to the SQL action? the error means it is not a applicable sintax for that operation


0 additional answers

Sort by: Most helpful