Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

How to identify if a data node exist?

adeivasigamani
Level 4
Level 4

Hi,

If a form is binded to a schema, and when the xml is supplied to the form how to identify an optional node in the xml is available or not.

for example if I have a XML input like below

<root>

     <childTable>         

          <childRow>

               <child1>

               <child2>

          </childRow>

          <childRow>

               <child1>

               <child2>

          </childRow>

     </childTable>

</root>

is it possible to identify if the childTable node is present in the xml input.

The code xfa.datasets.data.root.childTable if used fails when the childTable is not present in the input xml?

Please let me know if there is a way to identify if the input xml has  a specified node. Assuming that we know the path of the node in the xml structure.

Regards -

Ashok Deivaisgamani

1 Reply
kvdvijaykumar
Level 4
Level 4

Hi Ashok,

Could you please try this?

var nodeCheck = xfa.resolveNode("$record.childTable");

if(nodeCheck != null)

{

     app.alert("Node Exists");

}

else

{

     app.alert("Node Not Avaliable");

}

Thanks,

VJ