Promoting optional fields

From: Claudio Sale (
Date: 11/09/04

Date: Tue, 9 Nov 2021 09:24:09 -0800

I have promoted as distinguished field an attribute of my xsd that is
optional (not required).
If I use the expression myMessage.myDistinguishedField, I have an error if
the optional field doesn't exist in the xml document.
How can I check if the field exists before using the distinguished field?