Expand my Community achievements bar.

SOLVED

Fill in form with information from another form

Avatar

Level 2

I have 2 forms.  I would like to Auto-populate the second form with the information from the first form.  How would I go about doing that?  I tried importing the xml data from the first form into the second form and nothing happened.  All the fields on the second form have the same name as the corresponding fields on the first form.  I'm not sure what else i'm missing/need to do.

Any help is much appreciated!!

Thanks,

Rose.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

The data can be imported into another form but if it is not based on the same structure or schema (having the same name is not enough) then you can map the inbound data to the fields on your form (this is called binding). In the dataview tab you can create a new data connection (use the sample xml option) and your data structure will appear in the palette. Then simply drag and drop each data node onto the field where the data shoudl go. An icon will be displayed beside the data node to indicate that it has been bound. Now when you import the data the product knows where you want the data mapped.

You can also see where each field on the form is bound by highlighting the filed and clicking on the binding tab.

Paul

View solution in original post

9 Replies

Avatar

Correct answer by
Former Community Member

The data can be imported into another form but if it is not based on the same structure or schema (having the same name is not enough) then you can map the inbound data to the fields on your form (this is called binding). In the dataview tab you can create a new data connection (use the sample xml option) and your data structure will appear in the palette. Then simply drag and drop each data node onto the field where the data shoudl go. An icon will be displayed beside the data node to indicate that it has been bound. Now when you import the data the product knows where you want the data mapped.

You can also see where each field on the form is bound by highlighting the filed and clicking on the binding tab.

Paul

Avatar

Level 2

do I create that in the first form or the second form?

Avatar

Level 10

Both the forms should have the similar data connection and bindings to the fields. Then only the XML data from one file can populate the second form..

Thanks

Srini

Avatar

Level 2

Sorry for the simple questions...I am a true beginner at this

So I need to have the same data connection in both forms then?

Avatar

Level 10

The reason I said both the forms needs to have the same data connection because in your earlier post you said you are trying to generate the XML from one form and importing to the other form.

If you want to display the data from the XML to a field, that field needs to be bound to that XML tag where you expect the data. For this you need to create a data connection in the form.

What Paul mentioned was you need to first create a data connection with the XML structure you have and then bound the fields on your form with the respective tag. When the field is bound, you can see a icon displayed next to the tag name as shown below image. In the below image I have bound many fields in UserInfo section of the XML except the userId, homeAddress, homePhone, faxNumber, pagerNumber.. So you don't see a icon next to those tags. Rest of the tags are bound to a field on the form.

Once you do a similar binding to your form fields, when you import the XML data from another PDF, data connection will know which tag value will be displayed in which field.

The issue you might have is you did not have the Data connection and binding done in the second form.

    

Thanks

Srini

Avatar

Level 2

Great.  Thanks.

This works for the text fields.  My next question is...can I do this with the checkboxes?

Avatar

Level 10

Yes you can do the same way to the checkboxes also. You can use the Default binding to bind the check box to a XML tag..

But the tick mark (Check) in the checkbox will depend on the value in the XML.

For example in the below image I set the on Value as 1 and off value as 0. That means if I bound this check box to a XML tag and if the value of the tag is 1 then the check mark will  be displayed. Other wise it will not be checked. You can change these values to to what ever way you expect in your XML.

Some prople replace 1 and 0 with Yes and No.

CheckBox Values.jpg

Thanks

Srini

Avatar

Level 2

Thanks to everyone for their help.

My last question was because when I did the "drag and drop" to bind the data to the field, it changed them all to text fields. All I needed to do was go back through and change it back to a check box.

Thanks again!!

Avatar

Level 10

You are correct. Change the Type property in the Field tab to CheckBox.

Thanks

Srini

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] ----