Skip to main content
Participating Frequently
May 29, 2024
Answered

Drop down export value to text field for Mileage

  • May 29, 2024
  • 2 replies
  • 1291 views

I have a a mileage pdf that I want to turn into a form (attached for reference). It already includes a table for specific locations and the actual mileage between those locations. I've determined that creating a drop down list for the Beginning Site and Ending Site would be best however, do I make them two separate drop down fields or one combined drop down field?  If I make it one combined drop down (named DropDown1.0) then I can enter an Export Value in the Properties Options based on the provided table. What I can't figure out next is how to get that Export Value to display in a text field named MilesRow1. Do I make a custom calculation script within the drop down field or the text field? What does the script need to be?

 

I have spent days reading all the existing community answers to this question but am not understanding what I need to do for my particular situation.  Any guidance would be much appreciated. 

This topic has been closed for replies.
Correct answer Nesa Nurani

To show export value from dropdown in text field, you can use custom calculation script in text field like this:

event.value = this.getField("DropDown1.0").value;

 

You could also use two dropdown fields, and then with a script you can check both dropdown values and set mileage depending on two dropdown values, it's a little more complex script but not too hard.

2 replies

Participating Frequently
May 30, 2024

Update: Even thought using one drop down for both the beginning and ending site would be easier, it creates too many options in the drop down. If I did two separate drop downs would I still use the Export Value field? What would the script need to say?

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
May 29, 2024

To show export value from dropdown in text field, you can use custom calculation script in text field like this:

event.value = this.getField("DropDown1.0").value;

 

You could also use two dropdown fields, and then with a script you can check both dropdown values and set mileage depending on two dropdown values, it's a little more complex script but not too hard.

Participating Frequently
May 29, 2024

I tried that based on another community thread and the MilesRow1 text field doesn't do anything. Should I have the "Commit selected value immediately" checked on the drop down field for the script to work?