Expand my Community achievements bar.

Import xml file Question

Avatar

Level 7

Here is my senario:

I have distribute a form and I have collect responses. Then I have export(save) the responses as a .xml file.

Here is the .xml file:

<?xml version="1.0" encoding="UTF-8" ?>

- <Data>
- <!--
CopierTest_distributed_0001.pdf
-->
- <form1>
<Copier>Xerox</Copier>
<Meter>300</Meter>
</form1>
- <!--
CopierTest_distributed_0001.pdf
-->
- <form1>
<Copier>Canon</Copier>
<Meter>2000</Meter>
</form1>
</Data>
Is it posible to import the xml into a dynamic form with the two fields(Copier and Meter)
8 Replies

Avatar

Level 7

I forgot

the fields copier and Meter should be repeating.

Thank you

Avatar

Level 5

Hi,

Based on the data you have provided you would need to do something like this.

- Create a document in designer.

- create 2 text fields ( one for the copier name  and  one for  Meter)

For each field you need to go to the binding tab and set

     Data Binding = "$.Copier" ( without quotes) for the copier text field  AND

     Data Binding = "$.Meter" ( without quotes) for the Meter text field.

- wrap the two fields in a subform

In the details for the subform set the following in the Binding Tab

     Data  Binding = "$.form1[*]" ( without the quotes)

     Repeat subform for each data item  should be checked  ( If this is greyed out, wrap this subform in a subform)

If you then create a XML file from your data and use this in the preview settings of designer you can preview the document and see what it looks like.

I can hopefully workout someway to get a sample file so you can see what has been done

Regards

Malcolm

Avatar

Level 7

Hi Malcom,

I have follow your directions but any time when I have to import a new  data to a new instance

form deletes the added new instance and resets the previous data entry  with the new one

which suppose to be for instance number 2!

What I am doing wrong?

On the form I have add a button to import data:

xfa.host.importData();

Before I Import the data I add a blank instance to the form.

Thank you

Avatar

Level 5

Hi,

Can you upload your files to a sharing site ( such as acrobat.com ) so that I can look at the files as that will help me try to solve the problem?

Regards

Malcolm

Avatar

Level 5

Hi,

This works as I would expect it to, but I think maybe we are not quite solving the same problem.

If I understand your possible solution is that you want to import more than one data file per form so that each import adds a new entry to the form. This will not work as it stands because the data you import replaces the data that form already has and this means that you would see just the entries for the latest data file. Is that the problem?

Regards

Malcolm

Avatar

Level 1

Hi Malcom,

yes this is my problem. I do not want the data I am entering to replace the previous one!

There is any solution or suggestion I can follow?

How I can collect all the data from different departments to one form?

Thanks again