I am creating an Azure Logic App (standard) workflow that executes SQL query then save it as CSV and upload to Sharepoint. Please see below workflow.
The "Execute Query" is just a "Select requests" query from the Azure SQL database. Then the results will be the input in the "Compose" data operations. Then Initialize variable for the filename that have extension of ".csv" and will upload the output of that in the Sharepoint using "Create a file" action. But when I run this workflow, the uploaded csv file is just a single row excel file and no columns. Tried using the "Create CSV table" data operations actions but returns an error that the output from execute query is not an array. How can I configure the workflow or make the SQL query output as an array?

This is the CSV output:
