Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Prepopulate XML

Avatar

Former Community Member
Hello,



I would like to use data to prepopulate fields in a form viewed in Workspace. I would also like to use the same data for mapping purposes like sending email, task instructions, etc.



I am using the assign task to view an xfaForm in which I would like to insert data.



I am new to LiveCycle. Can anyone help..... please



Thank you
14 Replies

Avatar

Former Community Member
Is this the 1st step that starts the process or somewhere in the middle of the process. Are you using a n XDP template to render to the user or a pre-created PDF? Where will this data for pre-population come from? Is it in XML format or are you merely pushing a couple of field values into the data?

Avatar

Former Community Member
>>Is this the 1st step that starts the process or somewhere in the middle of the process.

This would be the middle of the process as I would like to extract data first.



>>Are you using a n XDP template to render to the user or a pre-created PDF?

I am trying to use the extracted data from an interactive PDF to insert in an XDP and to prepopulate in other tasks (using XPATH) e.g. task instructions, sending email, etc.



>>Where will this data for pre-population come from?

Interactive PDF



>>Is it in XML format or are you merely pushing a couple of field values into the data?

I would like to extract the data a XML format to prepopulate the XDP form.



Thank you for helping.

Avatar

Former Community Member
If you are using an XFAForm Variable to render your form, when the user submits the form back in the data in that form will be pushed into the xfaForm Var. Look under the xfa/datasets/data node. Using XPath expressions you can take all or part of the data out and write the to process variables. You can alos push data back into individual nodes in this variable. Then pass it into the next user step. By doing this Livecycle will merge the data onto the template and render in automatically for you.

Avatar

Former Community Member
Paul - Thank you for replying.



I can extract data and reuse it in an xfaForm variable when the form was submitted in Workspace.



I am having trouble with extracting data from an interactive PDF that has been taken offline and emailed back to the Workflow Server. I would like to then reuse the extracted data functionality like task intructions, sending notifications, inserting data in an email template, etc.



I am unable to extract data to an xfaForm variable suing the Export Data module.

Avatar

Former Community Member
Make sure that the variable that you define as output in that service is a dcoumnt. Then use a setValue to cast the document to an XML variable.

Avatar

Former Community Member
Thanks Paul



it worked !!



Apparently the format it extracts the data is a bit differently to my expectations. When I try to render the PDF and merge the extracted XML, I get a "type mismatch" error. I think there is some tag mismatch.



However, when I try to merge the same document with another XML I manually created as a sample, it works just fine and I am able to view the PDF with the merged data.



Is there a way to reference the XSD while extracting the data so it extracts as per the XSD ?

Avatar

Former Community Member
If you bind the form using the schema definition in the 1st place it will extract it in the format of the schema automatically.

Avatar

Former Community Member
I have bound and embedded the XSD in the form. However, there are a few additions which is causing this error. <br /><br />Manual XML file which works:<br /><br /><?xml version="1.0" encoding="UTF-8" ?> <br /><WorkflowSample><br /><personaldetails><br /><firstname>John</firstname> <br /><lastname>Smith</lastname> <br /><email>aditya.shah@gsinc.com</email> <br /></personaldetails><br /><Decision><br /><Approve /> <br /><Decline /> <br /></Decision><br /></WorkflowSample><br /><br />Workbench extracted XML through "export data" module which gives a "tag mismatch" error:<br /><br /><?xml version="1.0" encoding="UTF-8" ?> <br /><xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xmlns:dd="http://ns.adobe.com/data-description/"><br /><xfa:data><br /><WorkflowSample><br /><personaldetails><br /><firstname>retert</firstname> <br /><lastname>rtretr</lastname> <br /><email>retert</email> <br /></personaldetails><br /><Decision><br /><Approve /> <br /><Decline /> <br /></Decision><br /></WorkflowSample><br /></xfa:data><br /><dd:dataDescription dd:name="WorkflowSample" xmlns:dd="http://ns.adobe.com/data-description/"><br /><WorkflowSample><br /><personaldetails><br /><firstname /> <br /><lastname /> <br /><email /> <br /></personaldetails><br /><Decision><br /><Approve /> <br /><Decline /> <br /></Decision><br /></WorkflowSample><br /></dd:dataDescription><br /></xfa:datasets><br /><br />I noticed the few differences. <br /><br />1) From "<dd:dataDescription dd ...." the second set of XML tags are added<br />2)"<xfa:data>" is also an addition, which I think seems to be the problem. <br /><br />Do you know any other way of extracting XML or controlling how the data is extracted ?<br /><br />Thanks.

Avatar

Level 10
Try to export the data with the processFormSubission from the Form service instead.



Jasmin

Avatar

Former Community Member
Jasmin - I don't get any XML output from a prefilled PDF. When I Record and Review, I do not see anything assigned to the Output XML variable. This way nothing is passed to the next process and the resultant form doesn't have any data to merge and therefore appears blank.



I have specified the CONTENT_TYPE=application/pdf



Thank you for helping.

Avatar

Level 10
Make sure to set the 'Populate XML Data' to true and 'Export Data Format' to XML Only.



Jasmin

Avatar

Former Community Member
I did a record and review of the workflow and I still don't get any XML output after implementing your suggestions.



However, changing "Export data format" to XDP helped. I reverted back to the original settings for "Populate XML Data".



I am now able to extract XML and reuse the data in and outside the form.



Gary and Jasmin - Thank you for helping

Avatar

Former Community Member
> Hi,<br /> <br /> I am new to adobe interactive forms and i have to pre-populate the adobe form dynmicaly before display it on browser with the data availabe in my client machine where am using java api to read the from template from Adobe form server.<br /><br /> I have created XML and passing it as data to the processFormSubmission method, but the form not getting populated with data.If i see the output data it has the repeated tags in <xfa:data> </xfa:data><br /><br />Sample XML: <?xml version = '1.0' encoding = 'UTF-8'?><br /> <ListOfPubSampleUploadContact>");<br /> <Contact><br /> <FirstName>Sreenivasulu</FirstName><br /> </Contact><br /> </ListOfPubSampleUploadContact><br /><br />Java Code: com.adobe.idp.Document formData = new com.adobe.idp.Document(defaultData); <br /> <br /> // set the Rendering Options<br /> RenderOptionsSpec processSpec = new RenderOptionsSpec();<br /> processSpec.setLocale("en_US");<br /> processSpec.setXMLData(true);<br /> processSpec.setExportDataFormat("XDP");<br /> <br /> <br /> FormsResult formOut = formsClient.processFormSubmission(<br /> formData, // form data<br /> "CONTENT_TYPE=application/xml", // environment buffer<br /> "", // user agent details<br /> processSpec // options<br /> );<br /><br />Regards,<br />Sreeni.

Avatar

Former Community Member
Can you try merging the data onto the form in Designer preview mode first to see if the dta is bound correctly or not.