Hello lovely UIPathers
I am hoping someone can guide me towards how I can extract the restAPIVersion from this deserialized XML:
Tried just about everything I can think of without success & grateful for any pointers.
Thank you!
Hello lovely UIPathers
I am hoping someone can guide me towards how I can extract the restAPIVersion from this deserialized XML:
Tried just about everything I can think of without success & grateful for any pointers.
Thank you!
@aidan.moore
Welcome to the forum
you may have to handle XML namespaces
Have a look here
Maybe you can share the XML as text with us
Going ahead
Serializing the XML - output: xDoc | DataType: XDocument:
Checking if we have to handle XML namespaces
We do have:
Checking for some children:
Defining Namespace Variable
xnsDefault = xDoc.Root.Name.Namespace
Checkin the retrieval
xDoc.Descendants(xnsDefault + "productVersion")
GetDescendants { [<productVersion build="456" xmlns="http://tableau.com/api">123</productVersion>] }
xDoc.Descendants(xnsDefault + "productVersion").First().Value
"123"
xDoc.Descendants(xnsDefault + "productVersion").First().Attribute("build").Value
"456"
xDoc.Descendants(xnsDefault + "restApiVersion").First().Value
"3.12"
About Prototyping / RnD
we recommend to work within the immediate panel as we can check and prototype very fast
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum
Thanks Peter!
Annoyingly I had squiggly brackets around the XNamespace until I read your solution.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.