Skip to main content
August 27, 2016
Answered

If/Then script that calculates a number value based on text values

  • August 27, 2016
  • 1 reply
  • 468 views

I have a dropdown list of various equipment models with a text box beside it that shows the equipment rating. How can I make the equipment rating automatically populate based on the equipment model? The equipment models and their appropriate ratings are listed below.

Equipment ModelEquipment Rating (kW)
SE3000A-US (240V)3.00
SE3800A-US (240V)3.80
SE5000A-US (240V)5.00
SE6000A-US (240V)6.00
SE7600A-US (240V)7.60
SE10000A-US (240V)10.00
SE11400A-US (240V)11.40
This topic has been closed for replies.
Correct answer try67

Enter the ratings as the "Export value" of each item in the drop-down and then use this code as the custom calculation script of the text field (adjust the field names as required):

event.value = this.getField("Equipment Model").valueAsString;

Also, make sure you tick the option to commit the selected value of the dropdown immediately (under its Properties - Options tab), so that the text field will update as soon as a selection is made.

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
August 27, 2016

Enter the ratings as the "Export value" of each item in the drop-down and then use this code as the custom calculation script of the text field (adjust the field names as required):

event.value = this.getField("Equipment Model").valueAsString;

Also, make sure you tick the option to commit the selected value of the dropdown immediately (under its Properties - Options tab), so that the text field will update as soon as a selection is made.

August 27, 2016

Thank you!