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

How to Add TextElement Dynamically to TableElement in XmlPort

(1) ShareShare
ReportReport
Posted on by 102

Dear Community,

i am working on a requirement in which i am exporting data into a text file using XmlPort object. i need some help regarding this. is it possible to add textelement to tableelement at runtime ? Please see screenshot. i want to add these textelement dynamically. Thanks 

i am using Business Central 14.0.0

pastedimage1573069189046v2.png

I have the same question (0)
  • Suggested answer
    DanieleLixi Profile Picture
    5 on at

    From my understanding the elements cannot be added dynamically but can be excluded dynamically instead.

    You can use an OnBeforePassVariable trigger on each of your textelements to conditionally skip them like so:

    textelement(No)

    {

       trigger OnBeforePassVariable()

           begin

               if *some condition here* then

                   currXMLport.Skip();

          end;

       end;

    }

    If you found a solution to conditionally add nodes I would love to know about it, since I am also working on a similar requirement.

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,958 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,101 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 959 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans