What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    How to pass the highest selected number in a matrix to another field

    Asked by Firemedic07 on November 16, 2016 at 10:35 PM

    I have a drop down style number selector 0-400 that there are multiple selections. I am looking to put the highest number selected in another field in my form. 

    Page URL:
    https://form.jotform.com/60758875200156

    Screenshot
    selected another put
  • Profile Image
    JotForm Support

    Answered by candy on November 17, 2016 at 02:10 AM

    Hello,

    I have cloned your form in order to test it on my side. As I have understood your question, you have wanted to set a predefined value to the dropdown lists of the matrix. If so, as I have check it is not possible to set a predefined value to a matrix.

    What I do not understand is what do you mean by "I am looking to put the highest number selected in another field in my form." Which field in your form, do you want to set the highest number? In the matrix, or in the another field of your form?

    Could you please explain your question further?

    Waiting for your response.

    Thanks in advance.

  • Profile Image

    Answered by   on November 17, 2016 at 06:11 AM

    There is another field on the form called "highest level of CO". I want that to auto populate with the highest number that was picked in the drop down "CO Detector Findings"

  • Profile Image
    JotForm Support

    Answered by Boris on November 17, 2016 at 08:31 AM

    This is possible by using our insert/calculate type conditions, but it may appear to be tedious when setting it up. Basically, we will use conditional logic to pass a value from the Matrix field to your desired Text Box field:

    https://www.jotform.com/help/268-How-to-Insert-Text-or-Mathematical-Calculation-into-a-Field-Using-Conditional-Logic

    You can see a demo form of this functionality here:

    https://www.jotformpro.com/form/63213632639960

    Now, in order to achieve that requirement, we will perform several steps. please make sure to follow the steps correctly in order for the calculation to work the way you asked.

    1. We should add an insert/calculate condition to your form. We will set it up so that "IF Matrix field is filled, DO calculate a field's value", and then click on the ... button to add a mathematical function:

    2. Add the max() function:

    3. Place your cursor inside the max() function, which means inside its brackets ( and ), and then click on the Add Field button:

    4. Select the Matrix field, and then make sure to select all its checkboxes that appear, and then its Done button:

    5. Now comes the trickiest part. The above steps have left us with all the individual rows of the Matrix field inside the max() function, but now we need to separate the fields with a mathematical comma. This is how the calculation looks at the start of step 5:

    Now, you need to click between each and every two rows, and add a comma in between:

    This has separated each row with a comma, but if the background of the comma is light gray, it means the comma is literal text, and not a mathematical one.

    6. In order to change each comma to a mathematical one, simply click on the comma until it gets the same dark background as the 0-9 numbers have:

    7. Finally, complete the condition by selecting the "Summary" field where it will forward this calculated value, and click on Save:

    This should leave you with the same functionality that is demonstrated in the form linked above. Please try it out, and let us know should you run into any snags along the way or if you need further assistance setting it up. :)

  • Profile Image

    Answered by Firemedic07 on November 20, 2016 at 04:15 PM

    Worked awesome. What would i have to do differnt if I wanted to use a Numeric Text Box instead of the Drop Down?

  • Profile Image
    JotForm Support

    Answered by jonathan on November 20, 2016 at 05:40 PM

    You meant you want to use Numeric textbox as the input type in your Matrix table field?

    You can go ahead and change it in the Matrix table option in the toolbar...

    The functionality should still work as can be test on this form https://form.jotform.com/63246397528971

    Let us know if you need further assistance.

     

     

  • Profile Image

    Answered by Firemedic07 on November 20, 2016 at 05:49 PM

    When i do that and enter 1-11 in the fields it enters 111 on the other field

     

  • Profile Image
    JotForm Support

    Answered by jonathan on November 20, 2016 at 06:18 PM

    Can you please describe more how to produce that issue.

    I test the form https://form.jotform.com/63246397528971 but I could not see it.

     

     

  • Profile Image

    Answered by Firemedic07 on November 20, 2016 at 06:39 PM

     

    This is what happens when I put numbers in. 

  • Profile Image

    Answered by Firemedic07 on November 20, 2016 at 08:19 PM

    Figured it out. Thank you all.