XML element missing

Hey,

Please advise me, after deserialize xml file i can get all details from it, but what to do if element is missing?. For example i have web questionnaire where is alternative Telephone number field (not mandatory to fill in), when person fills it in, i get xml file included with alternative tel number and by using assign activity i get it, but when person leaves it empty (don’t have any alternative number), xml file doesn’t even show that it there is something with alternative Telephone number and automatically i get error from uipath that element not found. any solutions?

Do you have a sample XML file? How are you accessing these XML elements?
Maybe you can insert a check to see if the element is there before actually trying to access it.

hey,

i have clarified it by Reading with IF condition :slight_smile:
IF isNothing(XMLvariable.element(“root”)… and it works perfectly fine
Thanks for helping ,)

Hi,

How to check element name valid or not?

Use if activity and begin with ISNOTHING or ISTRUE then . ‘dot’ describe that element and convert to string. Or explain Little more on what you want to do

1 Like