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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to set space in .txt file for blank record

(1) ShareShare
ReportReport
Posted on by 230
Hi Team,
 
Using below link i have generated the .txt file.
 
If there is no data in file 0 should come.
 
Please let me know how zero will come instead of blank.
I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    240,288 Most Valuable Professional on at
    It's sounds simple - replace empty strings with '0' before calling TextStreamIo.write().
  • CU21091228-0 Profile Picture
    230 on at
    Hi Martin.
    Please let me know at which place should i write '0'
  • Martin Dráb Profile Picture
    240,288 Most Valuable Professional on at
    You provide values and call write() method at line 24.
  • CU21091228-0 Profile Picture
    230 on at
    Could you please provide me the sample code?
  • Suggested answer
    Mohit Rampal Profile Picture
    12,573 Moderator on at
    Hi, You can set value zero if field value is blank but you need to add it in String as all your fields are string fields.
     
    while select custTable
    {
    
      if (!custTable.custGroup)
      {
          custTable.custGroup = "0";
      }
    }
     
  • Verified answer
    Martin Dráb Profile Picture
    240,288 Most Valuable Professional on at
    For example:
    private str zeroIfEmpty(str _input)
    {
        return _input ? _input : '0';
    }
    
    ...
    io.write(... this.zeroIfEmpty(custTable.CustGroup)));

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 284 Super User 2026 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 258 Most Valuable Professional

#3
Anton Venter Profile Picture

Anton Venter 228 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans