Expand my Community achievements bar.

XML import into floating fields issue

Avatar

Former Community Member
Probably missing something obvious, but my searches are coming up blank. Here's the workflow I'm shooting for:<br /><br />-Create form1 in LCD<br />-User fills out form and submits via email the XML data<br />-Create form2 in LCD that uses floating text fields to create a dynamic text document based on the info in form1<br />-Import XML data from form1 into form2<br />-Print form2<br /><br />Most of it works, but there is a subform on form1 that form2 doesn't import the data from.<br /><br />The XML winds up like this:<br /><variable1>Variable 1 Info</variable1><br /><variable2>Variable 2 Info</variable2><br /><subform><br /><variable3>Variable 3 Info</variable3><br /><variable4>Variable 4 Info</variable4><br /></subform><br /><br />In this example, form2 properly imports variable1 and variable2, but ignores variable3 and variable4. Manually removing the <subform> tags yields the desired result.<br /><br />Something in the text field binding in form2, maybe?<br /><br />Thanks in advance,<br />SyddyS
6 Replies

Avatar

Former Community Member
In Form1 are variables 3 and 4 wrapped in a subform (look in th eheirarchy view)?

Avatar

Former Community Member
Hi Paul,



Yes. In the above example variables 3 and 4 are on a subform. Apologies if I wasn't clear.



The easy answer would be to just unwrap those variables, but unfortunately in the "real world" version of form2, those variables are on a subform that appears or disappears based on a radio button selection. I guess I understand why the XML is showing up the way it is based on form1, but my question is more about how to get form2 to properly import that data.



Thanks,

SyddyS

Avatar

Former Community Member
Then wrap your Variables 3 and 4 in the subform in Form 2 or export the data from Form 1 and map those variables onto the Fields that you want in form 2.

Avatar

Former Community Member
The answer appears to lie in the hierarchy and naming. All forms, pages, subforms, etc. have to be named exactly the same and have the same hierarchical flow for the floating text fields to bind properly to imported data. This kind of blows for my purposes, as "form2" had my text fields spread across multiple pages and multiple subforms. Naming all the subforms the same as the subform in "form1" made the first one work, but none of the subsequent.



If anyone has any alternative thoughts, I'd appreciate it. My workaround is to put ALL of my text fields in form1 on the same level, and then call them out one by one in the scripting to make the ones I want visible or hidden. Wrapping them in a subform just causes too much trouble down the line. Ugly, but functional.



Thanks,

SyddyS

Avatar

Former Community Member
Your other option is to export data from the 1st form (to get a data structure) then use it in a data view in the 2nd form to map the fields from one data file to the other. In this way you do not have to follow the same form structure in both forms.



Hope that helps

Avatar

Former Community Member
Just in case another rookie runs across this thread, here's what appears to work for me:



When binding the floating text field in "form2", I changed the "Default Binding" drop down on the Binding Tab from "Normal" to "Global". As soon as I did that, the hierarchy and naming of the subforms no longer mattered- only the name of the field itself.



See "To Define a Global Field" in Help. Why can't I ever find things like that in Help BEFORE I get frustrated and hit the forums? I swear I do search there first...



Hope that helps others out. Thanks for your help, Paul. It was when I was playing with the data import that I discovered this option.



-SyddyS