Repeating field value in added instances | Community
Skip to main content
Level 2
May 31, 2022
Solved

Repeating field value in added instances

  • May 31, 2022
  • 2 replies
  • 1150 views

Hello,

 

Here's link to my form: https://we.tl/t-HX3piyQgMX

 

I want to create the form where the value from REFERENCE3 field repeats in SECTION 3 - REFERENCE 3 field. The thing is that when the plus button is pressed the new REFERENCE 3 section comes in as well as SECTION 3 section, so that each reference is connected with each table. (I hope that makes sense). 

I had similar problem recently that was solved (https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager-forms/autopopulate-repeat-data-in-the-field/m-p/443847#M8657 - link)  and I tried to use the same code, just modifying it, but I don't know what I do wrong, because it's not working.

 

Thanks,

Magda

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by MHWinter

The issue I found was that the Data Binding for REFERENCE 3 in Section3 was set to "use global Data". By setting it to "Use name" and with the following script in the Exit event of REFERENCE3 field in Section 1, it seemed to be working

var nIndex = this.parent.index;
var sTarget = "form1.Page1.SECTION3["+ nIndex +"].section3FillIn.sectionWrap.ref3";
this.resolveNode(sTarget).rawValue = this.rawValue;

2 replies

Mayank_Gandhi
Adobe Employee
Adobe Employee
June 3, 2022

@magda93 What's the use case? To get value from top to newly added section?

magda93Author
Level 2
June 3, 2022

Yes

MHWinter
MHWinterAccepted solution
Level 4
June 6, 2022

The issue I found was that the Data Binding for REFERENCE 3 in Section3 was set to "use global Data". By setting it to "Use name" and with the following script in the Exit event of REFERENCE3 field in Section 1, it seemed to be working

var nIndex = this.parent.index;
var sTarget = "form1.Page1.SECTION3["+ nIndex +"].section3FillIn.sectionWrap.ref3";
this.resolveNode(sTarget).rawValue = this.rawValue;
magda93Author
Level 2
June 7, 2022

Thank you so much. This code is brilliant and it will help me with my other forms.

 

Thanks,

Magda