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
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

LiveCycle - Dropdown text value to be calculated in repeatable Subform

PCForm
Level 2
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
_Bruce_Robertson
Correct answer by
Level 10
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
_Bruce_Robertson
Correct answer by
Level 10
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