Expand my Community achievements bar.

SOLVED

Using multiple xml files to populate 1 form.

Avatar

Former Community Member

Hi All

Thank you for reading this.

My scenario is I have a form which is  inspection report for a product.

Once the technician has finished their inspection they fill in the form and submit it (which saves the form data in xml format to a specific folder on our network.

Now 1 customer may have up to 10 items being inspected on a single order. What I need to do is create a customer report showing them the work required on their items.

Basically I need to be able to import up to 10 inspection report xml files into 1 report form.

I was looking to do this with instances but am struggling.

I can get 1 data file imported using xfa.host.importdata("filename")

but this method appears to reset the form after the first call so the second instance of the form in the report form does not get any data. (if this makes any sense)

How can I set up my report form so I can populate different instances of the subform from different xml files?

i.e. my xml file names are formatted with call number and line number e.g. 42E11134-5.xml  this would be call no. 42E11134 line 5.

the folder on the network would have 42E11134-1 up to possibly 42E11134-10 (no higher because we cap the maximum items on a single order)

I need 42E11134-1 data on to appear on subform instance 1, 42E11134-5 to appear on subform instance 5 etc etc, and also recognition of the number of instances required (although this could be selected by the user).

If instances wont work I am happy to have 10 seperate subforms with different names but the must exist within a single form.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

You can only import a single XML file. You may have an xml file that has multiple occurances of data but it must be a single xml file.

So you woudl have to find a way to combine all of those xml files into one then do the import.

Paul

View solution in original post

1 Reply

Avatar

Correct answer by
Former Community Member

You can only import a single XML file. You may have an xml file that has multiple occurances of data but it must be a single xml file.

So you woudl have to find a way to combine all of those xml files into one then do the import.

Paul

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----