question

NeilLinguaBuddy-2572 avatar image
0 Votes"
NeilLinguaBuddy-2572 asked NeilLinguaBuddy-2572 commented

Export CSV results to file - Bad Request Error Message

I'm trying to create a simple recurring data export from an Azure SQL database. using Azure Logic Apps.

I want the process to be
- Time recurrance
- Run query
- Export results to Storage account

However, I'm unexpectedly failing due to the error message displayed below:

"BadRequest. The 'from' property value in the 'table' action inputs is of type 'Object'. The value must be of type 'Array'."

I cannot find any documentation shedding any light on this, and I definitely wasn't expecting an error message of this type from a "no code" solution.

I have tried skipping this step, but the file export is simple a file without a format, so I have to create a csv within the workflow. Any CODE FREE ideas how to correct / work around this?

77802-image.png






azure-logic-apps
image.png (21.4 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

77803-image.png



Additional - have tried both of the highlighted options when creating the csv - same result.

0 Votes 0 ·
image.png (26.4 KiB)

1 Answer

MayankBargali-MSFT avatar image
0 Votes"
MayankBargali-MSFT answered NeilLinguaBuddy-2572 commented

Hi @NeilLinguaBuddy-2572

Welcome to Microsoft Q&A! Thanks for posting the question.

As per the error, the input type is Object where the action Create CSV Table accepts the input type in Array.
If you check the output of your action execute sql query (V2) it will be dynamic. The response will be as below:

 {
   "ResultSets": {
     "Table1": [
       {
         "Column1": "Value1",
         "Column2": "Value2",
         "Column2": "Value3",
         "Column4": "Value4"
       }
     ]
   },
   "OutputParameters": {}
 }

To get the array values from the above output in the create csv table you need to traverse to Table1 as below. If you scroll down at the last of your dynamic content you will see the below dynamic content.

78066-image.png


78065-image.png

Hope the above helps you to resolve the issue. Please let me know if you need any assistance.

Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.


image.png (9.2 KiB)
image.png (14.9 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,

This almost works. Is there a way to specify UTF-8 encoding? I have a lot of special characters (ñ, á, é, í) that need to be kept intact in the output.

Without that encoding the file output would need further manipulation...

0 Votes 0 ·

Hi @NeilLinguaBuddy-2572

I couldn't observe the same behavior as you have mentioned. I can see the "create CSV table" action has the same output as input. I don't see any issue with the special character conversion. Can you confirm if the Value of "Columns" is selected "Automatic" for Create CSV table. If you are still facing the issue please share the sample input and output of your Create CSV table action along with the configuration of this action.
78437-image.png

0 Votes 0 ·
image.png (39.4 KiB)
image.png (37.4 KiB)

Hi, yeah after further investigation I agree - it's OneDrive mangling the file. When I view an output sent via ftp, I don't have the same problem.

0 Votes 0 ·