How to check if an XML element exists?

Currently I need to check if the “error” element exists, unsure how to do so though.

2023-01-06 15_16_41-DHRN Doc Upload - My Workspace and 9 more pages - Work - Microsoft​ Edge

Hi @David_Hernandez2,
please try below
XML_Result_Variable.Root.Descendants(“errormessage”).First().Value
check and update if you still face issue.

In addition to:

Use the Deserialize XML Activity provided by the UiPath.WebApi.Activities Package and get returned an XDocument Variable -e.g. with variable name xDoc

The following statement will return true (when found) or false (when not exists)

xDoc.Root.Descendants("error").Any()

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.