Check for tag existence

Hello everyone!
I added a set of tags to the list and then read data from them. In the loop, using this expression "item.XPathSelectElement (" period / period_info / end_date “). Value” I get the value of the tag. But the end_date tag may be missing, in which case an error will appear that there is no such tag. Is it possible in the same expression (item.XPathSelectElement (“period / period_info / end_date”). Value) to write a check for the presence of a tag, if there is no tag, then continue working? Thanks.

maybe you can check in advance:
xeEndElement = **item.XPathSelectElement (“period / period_info / end_date”)
isNothing(xeEndElement)
and access the value defensively
endValue = IF(isNothing(xeEndElement),"",xeEndElement.Value)

Thanks It works! There are no options to check for the presence of a tag immediately in item?

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