Expand my Community achievements bar.

Convert xfaform variable to document type

Avatar

Former Community Member
I have a simple requirement to convert the xfaForm type which is used to invoke the process in task manager to document type varibale.



The form developed is not following any xsd schema. But I want to read value assign into various form feild during the various operation of the process.



Is there any way by wchich I can do it. My intention to convert it into document type so that I can use export data and get the desire values but I am very much stuck up with the conversion from xfaForm to document type itself.
7 Replies

Avatar

Level 10
You don't have to convert into document type to get the data. The xfaForm variable will contain the data for your form. The following xPath /yourxfaForm/object/data gives you the data for the form.



You can also use /yourxfaForm/object/data/datasets/data/yourStructure/yourFieldName to get to the field directly.



You can also use /yourxfaForm/object//data/yourFieldName. The "//" will make a search in all the data to find the tag matching your field name.



If, for whatever reason you need to convert it into a document, then you'll need to use the RenderPDFForm operation from the Forms service.



Jasmin

Avatar

Former Community Member
Thanks Jasmin,



But as I mentioned my Form is not bound to any struture. So in the set struture I can have access to /process_data/myForm/object/data/xdp/datasets/data/FSFIELDS_



Lets say I have simple form with having a text field with the name myname and its not bound to any struture xsd. I want to access the field value of myname in Set Value operation then what the struture in need to follow.

Avatar

Level 10
You don't need a xsd to be able to parse your form structure from xPath.



You can also use /yourxfaForm/object/data/datasets/data/yourStructure/yourFieldName to get to the field directly.



You can also use /yourxfaForm/object//data/yourFieldName. The "//" will make a search in all the data to find the tag matching your field name.



It'll follow the structure of your XDP. If in your hierarchy in Form Designer you have form1/SubForm1/MyField, then you should be able to use /yourxfaForm/object/data/datasets/data/form1/SubForm1/MyField.



Jasmin

Avatar

Former Community Member
I tired both the options as described below.

I have the following the structure of XDP form1/subform1/TextField1



My Process having two components setValues and Variable Logger.



Two varibales defined: myForm of Type xfaForm and myString of type String



In the set value operation I tried reading and assigning the value of textfield1 as suggested in the following 2 manner.

In setValue operation used

1)Location /process_data/@myString Expression /myForm/object/data/datasets/data/form1/subform1/TextField1



2)Location /process_data/@myString Expression /myForm/object//data/TextField1



Result in the varible logger I always get the value of myString as null.

Please suggest if I am doing anything wrong.

Avatar

Level 10
Can you post the value of the xfaForm variable?



Jasmin

Avatar

Former Community Member
Below is the value of both the variables from the varible Logger o/p



[PID:1,902] [ActionID:2,204] Action Name: "log0" Start...

[PID:1,902] /process_data/myForm - com.adobe.idp.taskmanager.form.impl.xfa.XFARepositoryFormInstance: com.adobe.idp.taskmanager.form.impl.xfa.XFARepositoryFormInstance@981b27



[PID:1,902] /process_data/myString: null

Avatar

Level 10
That doesn't' tell us much.



Can you put it in a document variable using a setValue and write that document variable to the file system using the Write Document operation.



You can use a setValue with the following:

/process_data/myDocVar - /process_data/myXMLvar



Jasmin