Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

xml output for repeating field

kgetch
Level 4
Level 4

Hi there,

I have a repeating subform with only one text field. It is for an account name that could be up to five lines long (36 character limit each).

We are now working to pull the data entered by our users via xml file using a submit button. I expected to see each instance in the xml with a name, then an instance indicator but all I see is multiple instances of the same field name.

There is no way to tell which is Account Long name 1, account long name 2, etc so we can map each instance to the appropriate field in another system.

My expectation was to see the following in the xml.

Account_Long_Title[0]

Account_Long_Title[1]

Account_Long_Title[2]

Account_Long_Title[3]

Account_Long_Title[4]

Default count is 1 instance. New instances are added by the user with a simple button. script below.

var oSubform = xfa.resolveNode("Long_Title");

var oNewInstance = oSubform.instanceManager.addInstance(1);

xfa.host.setFocus(oNewInstance.Account_Long_Title);

Can anyone help with a suggestion to help identify each instance in the xml output? The data binding is set to name. Thanks!

2 Replies
radzmar
Level 10
Level 10

Hi,

what you see in the XML data is exactly the way XML works.

Repeated elements simply use the same namings and not any kind if indicator.

You can format your XML in the way you want using a XSLT stylesheet, but this isn't that easy to learn.

So, you also can add a second hidden text field to your repeating subform that will store the index of the repeated subform.

Just add a script in its calculate event.

this.rawValue = this.parent.index + 1;

kgetch
Level 4
Level 4

Thanks Radzmar!

That may fit the bill, but just for the sake of asking, is there a way to use that counter to append the field name with the count itself?