Skip to main content

Notifications

Announcements

No record found.

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

(4) ShareShare
ReportReport
Posted on by 22
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?
  • Gerardo Rentería García Profile Picture
    18,726 Most Valuable Professional on at
    CSVBuffer with different number of columns per line
  • Suggested answer
    YUN ZHU Profile Picture
    82,915 Super User 2025 Season 1 on at
    CSVBuffer with different number of columns per line
    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
  • Suggested answer
    Suresh Kulla Profile Picture
    47,787 on at
    CSVBuffer with different number of columns per line
    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
    Jainam M. Kothari Profile Picture
    7,933 on at
    CSVBuffer with different number of columns per line
    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
    Khushbu Rajvi. Profile Picture
    16,335 Super User 2025 Season 1 on at
    CSVBuffer with different number of columns per line
    Not sure but check this if helps: https://www.youtube.com/watch?v=cp91N4xFqlg

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

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

#1
YUN ZHU Profile Picture

YUN ZHU 616 Super User 2025 Season 1

#2
Mansi Soni Profile Picture

Mansi Soni 487

#3
Sagar Dangar, MCP Profile Picture

Sagar Dangar, MCP 391

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans