web
You’re offline. This is a read only version of the page.
close
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...
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,294 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,708 Moderator on at

    Hi,

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

    andreilungu.com/.../

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,111 Moderator on at

    Your xpath declarations does not look correct.

    try //ErrorMessage as your xpath.

  • NAV_with_Narang Profile Picture
    2,294 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

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 2,066

#2
YUN ZHU Profile Picture

YUN ZHU 658 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 595

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans