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 :
Small and medium business | Business Central, N...
Answered

AL Error in XPATH Query, while fetching XML nodes from an API Response (The XPath Query Does not Match any nodes)

(0) ShareShare
ReportReport
Posted on by 2,390 Moderator

Dear Experts -

I am trying to read an XML API Response and am close. However, I am unable to understand/comprehend an XPATH Query for fetching details of what is written in "<ErrorMessage>" node. I am able to read the Status and StatusMessage nodes successfully. Probably I need to create another ForLoop? If yes, how?

Please assist me in figuring out the XPath for locating <ErrorMessage>

Pasted is the XML API Response and below is the AL code which I have tried writing, but every time it returns an error

5554.png

70150.png

2046.png

8311.png

ajkauffmann 

I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    Hi,

    Please refer the below link, might be it help you.

    andreilungu.com/.../

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    Your xpath declarations does not look correct.

    try //ErrorMessage as your xpath.

  • NAV_with_Narang Profile Picture
    2,390 Moderator on at

    Thankyou, yes the XML Buffer approach was straightforward than nitpicking nodes. However, my code is pasted for reference below

    All it takes to insert data into XMLBuffer table is calling the function.

    pastedimage1673014890928v1.png

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 June Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 677 Super User 2026 Season 1

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 447 Most Valuable Professional

#3
YUN ZHU Profile Picture

YUN ZHU 366 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans