Skip to main content

Notifications

Announcements

No record found.

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)

Posted on by 2,236 Super User 2024 Season 1

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 

  • NAV_with_Narang Profile Picture
    NAV_with_Narang 2,236 Super User 2024 Season 1 on at
    RE: AL Error in XPATH Query, while fetching XML nodes from an API Response (The XPath Query Does not Match any nodes)

    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

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: AL Error in XPATH Query, while fetching XML nodes from an API Response (The XPath Query Does not Match any nodes)

    Your xpath declarations does not look correct.

    try //ErrorMessage as your xpath.

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: AL Error in XPATH Query, while fetching XML nodes from an API Response (The XPath Query Does not Match any nodes)

    Hi,

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

    andreilungu.com/.../

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans