Forum Discussion
Format output to CSV FILE
Hello jwb3d,
It looks like there are two separate issues:
body('Join') is returning the JSON object, so you're seeing both keys and values. Before joining the data, use a Select action (or map only the required fields) so that only the values are passed to the Join action.
For a proper new line in the CSV, use CRLF instead of LF:
decodeUriComponent('%0D%0A')or
'\r\n'
Your final expression would look similar to:
concat(
variables('HeaderLine1'),
decodeUriComponent('%0D%0A'),
variables('HeaderLine2'),
decodeUriComponent('%0D%0A'),
outputs('Join')
)This will generate the header followed by the data rows with the correct line breaks. If you're still seeing the field names (keys), the issue is with the data being passed into the Join action rather than the concat() expression itself.
Best regards,
Omkar Shinde
Microsoft Fabric Enthusiast | Power BI Consultant
💡 If you found this response helpful, please consider giving it a Kudos.
✅ If this resolves your question, please mark it as the Accepted Solution to help others in the community.