Prepopulating single choice field based on input table calculation

  • christie397
    Asked on April 24, 2024 at 6:51 PM

    Hello!

    I have a form with a row of 5 single-choice options, and my users are required to select one of four options from each of the 5 rows (shown in the attached image). I'd like to get a score (1-4) from each row, depending on which option was selected in each row, and use the total score of all 5 rows to set one of four options shown in a sixth row (shown in the attached image).

    I sure hope that makes sense.

    Assuming this capability exists, is there a help page on your site that can assist me with my form?

    Jotform Thread 14239931 Screenshot
  • christie397
    Replied on April 24, 2024 at 6:53 PM

    Sorry...I meant to say six rows of options, not five. IOW, selecting an option for "Range Control & Safety", "Staging & Reversals", etc., will be used to OUTPUT an option for "Overall Range Performance".

  • Mary JotForm Support
    Replied on April 24, 2024 at 9:09 PM

    Hi christie397,

    Thanks for reaching out to Jotform Support. Please allow me some time to check on this, I will get back to you with an update.

    In the meantime, let us know if you have any other questions.


  • Mary JotForm Support
    Replied on April 25, 2024 at 9:42 AM

    Hi christie397,

    Thanks for waiting. First, you will need to assign calculation values to each selection. Let me show you how to assign the calculation values:

    1. Select the input table field, then click on the Gear icon.

    2. Go to Options.

    3. Enter your Calculation Values.

    Prepopulating single choice field based on input table calculation Image 1 Screenshot 50

    Then you can add the form calculation widget to calculate the total score from the Range Work field:

    Prepopulating single choice field based on input table calculation Image 2 Screenshot 61

    Then, depending on the total score, you can create a condition such as the one below:

    Prepopulating single choice field based on input table calculation Image 3 Screenshot 72

    Here is the result:

    Prepopulating single choice field based on input table calculation Image 4 Screenshot 83

    The overall range performance is being populated depending on the score calculated in the Total field.

    Let us know if you have any other questions.

  • christie397
    Replied on April 25, 2024 at 9:47 AM

    This worked well. Sadly, now I guess I'm struggling with what the next step was I had in mind.

    Ultimately, my goal is to use the total calculated value to display an overall "level". Let's say the selections in "Range Work" total up to more than 100. In this case, I'd like a read-only field just below all the options to say "Exceeds standards". If the total is somewhere between 75 and 100, I'd say "Meets standard". As the total gets lower, I would change what the read-only field to another overall performance level.

    Is this also doable with some type of custom widget/label/text area?

    Thanks very much!

  • Silvano JotForm Support
    Replied on April 25, 2024 at 10:05 AM

    Hi christie397,

    Thanks for getting back to us. The overall level can actually be automatically selected using Update/Calculate Field conditions as instructed by Mary above. Here's how she did it: Prepopulating single choice field based on input table calculation Image 1 Screenshot 30

    Then here's the result: Prepopulating single choice field based on input table calculation Image 2 Screenshot 41

    The total will depend on the calculation values set on the Input Table.

    If that’s not exactly what you’re looking for, can you explain a bit more so I can help you better?

    Give it a try and let us know if you have any other questions.


  • christie397
    Replied on April 25, 2024 at 4:19 PM

    Thank you for your assistance.

    It seems like I'm doing this right, but I get an error when I save, and the message says to make the necessary corrections, but I'm given no indication of the correction I need to make.

    Prepopulating single choice field based on input table calculation Image 1 Screenshot 20

  • Jefferson JotForm Support
    Replied on April 25, 2024 at 5:13 PM

    Hi christie397,

    Thanks for getting back to us. I cloned your form and tested it to see if I could replicate the issue, but everything was working properly. Check out the screencast below to see my results:

    Prepopulating single choice field based on input table calculation Image 1 Screenshot 20

    Can you try it again and see how it goes? If you run into the same issue again, let us know, and we'll do some more testing to see what's going on. 

    In the meantime, let us know if there’s anything else we can do for you.




  • christie397
    Replied on April 25, 2024 at 7:25 PM

    It started working after I typed in the whole string (e.g., "Exceeds standard"). I thought I had to hit Tab between "Exceeds" and "standard" to indicate there was a space in there.

    It's working now!

 
Your Answer