web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

CSVBuffer with different number of columns per line

(5) ShareShare
ReportReport
Posted on by 41
When using the CSVBuffer to export data, the below code expects each line to have the same number of columns.
 
 
This is not always the case when writing a CSV. Has anyone had to create a workaround for this? Or should it be submitted as a bug to Microsoft?
I have the same question (0)
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    22,342 Super User 2026 Season 1 on at
    Not sure but check this if helps: https://www.youtube.com/watch?v=cp91N4xFqlg
  • Suggested answer
    Jainam M. Kothari Profile Picture
    15,960 Super User 2026 Season 1 on at
    Hello,
     
    The issue you're facing with the CSVBuffer expecting each line to have the same number of columns can be addressed by either pre-processing the data to ensure uniform column counts or implementing a custom CSV writer that handles varying column numbers. If these solutions don't work, consider submitting it as a bug to Microsoft for a more flexible CSVBuffer.
  • Suggested answer
    Suresh Kulla Profile Picture
    50,278 Super User 2026 Season 1 on at
    You should always have same number of columns for each row, if you don't have the data in the a specific column you still need to send blank empty. 
  • Suggested answer
    YUN ZHU Profile Picture
    100,212 Super User 2026 Season 1 on at
    Hi, Try TextBuilder Data Type, you can change the number of columns at will, just add some conditions.
    How to export data from tables to CSV (comma-separated values) file -> Using TextBuilder Data Type
     
    Hope this helps.
    Thanks.
    ZHU
  • Gerardo Rentería García Profile Picture
    26,108 Most Valuable Professional on at

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,059 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 994 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 664 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans