1
0
-1

Is there a easy way to get form xml data by using Fluent API.

Sindy




    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Hi Sindy,

      It depends on where you are trying to access it. If in a unit test, this works:

      txn = new TxnQuery()
          .setId(txn.id)
          .withPropertyMap()
          .withFormXml()
          .firstValue()
      
      
      XmlDoc formXml = new XmlDoc(txn.formXml)

      If you are within a transaction, this should work:

      XmlDoc formXml = new XmlDoc(txn.formXml)
      Good luck!
      1. Sindy Tang

        Thanks Sean!

        Actually I am after all the form data xmls from past submissions based on formCode. 

        Sindy

      2. Sean Colyer

        Hmm, I haven't tried it myself but this might work:

        txn = new TxnQuery()
             .setJobRefNumber("L9MKYT")
             .withFormXml()
             .firstValue()
        
        
        XmlDoc formXml = new XmlDoc(txn.formXml)

        Sean

      3. Sindy Tang

        Thanks Sean! It works!

        Sindy

      CommentAdd your comment...