Need help creating a script to display the maximum value from one field in another field

Avatar

Avatar
Level 1
johnt36490185
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
johnt36490185
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
View profile
johnt36490185
Level 1

25-09-2020

Greetings,

This is my first post and I am a novice with javascript and form calc, but I have a form with a dynamic, expanding table with a sum field at the end. I've got everything working they way I'd like, but the person I'm developing this for wants to see a field be automatically populated with the maximum value from this field. I'm at a loss and would really appreciate the help. Again, I am new here. Is there a way I can post the form for someone to review? Thanks!Screen Shot 2020-09-25 at 10.18.52 AM.png

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

25-09-2020

@johnt36490185  You can put the script on an exit event. Loop through the table values and read value of cell-like xfa.resolveNode("MyTable.Row1[" + i + "].txtName").rawValue;

keep the value obtained in the last cell in a variable and check inside the loop if the value in the next cell is bigger replace the current value with a bigger value else keep it same. At the end of loop, the largest value will be in the var.

Answers (0)