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

Notifications

Announcements

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,572

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 789 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 693 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans