Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

LiveCycle - Dropdown text value to be calculated in repeatable Subform

Avatar

Level 2

Hello,

I have a dropdown with two text selections (Account, Survey) in a repeatable Subform. 

Then I have two fields adding the selections.  # of Accounts per Region____  # of Surveys per Region ___.

If I add 10 repeatable rows selecting Account 6 times and Survey 4 times, how to write the script or form calc to sum the selections?

Dropdown.JPG

Thank you!



1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

You'll probably have to change the code to suit your field names and form structure but this JavaScript should do it in the calculate event of the “# of Account/Survey Reviews per Region” fields

xfa.resolveNodes('Table1.Row1.[ReviewType == "Account"]').length;

and

xfa.resolveNodes('Table1.Row1.[ReviewType == "Survey"]').length;

Here’s a sample to make sure of the code, https://sites.google.com/site/livecycledesignercookbooks/home/PCForm.pdf?attredirects=0&d=1

Regards Bruce

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi,

You'll probably have to change the code to suit your field names and form structure but this JavaScript should do it in the calculate event of the “# of Account/Survey Reviews per Region” fields

xfa.resolveNodes('Table1.Row1.[ReviewType == "Account"]').length;

and

xfa.resolveNodes('Table1.Row1.[ReviewType == "Survey"]').length;

Here’s a sample to make sure of the code, https://sites.google.com/site/livecycledesignercookbooks/home/PCForm.pdf?attredirects=0&d=1

Regards Bruce