How can I conditionally subtract the lowest value when selected options is more than 4

  • AZDBAdesze
    Asked on December 24, 2017 at 2:02 AM

    Looking to see if the JotForm can handle the following:

    A user chooses four options at the value of the following

    $650

    $650

    $250

    $50

    $100

    Total Due $1700

    But need to look for the smallest amount and subtract that amount from the Total Due which gives a new Total Due of $1650. The only way this subtraction is target is when a person choose more than 4 options. 

    If you need to see my form to help let me know. 


    Thanks





  • Support_Management Jotform Support
    Replied on December 24, 2017 at 3:46 AM

    Are these fixed values - Meaning, the values of your options will be 650, 650, 250, 100 and 50? If they are, then all you need are two things:

    1. The count() function, so you can count the number of options that were selected

    Related guide: Form-Calculation-Math-Function-Reference 

    2. Then, use that counted result in your condition, whether you'll deduct 50 or not

    For this, you can use the Form Calculation Widget which will be used to count the number of options selected:

    How can I conditionally subtract the lowest value when selected options is more than 4 Image 1 Screenshot 30

    Afterwards, setup the Condition to deduct 50 if the user selected more than 4:

    How can I conditionally subtract the lowest value when selected options is more than 4 Image 2 Screenshot 41

    See it in action here: https://www.jotform.com//73571517243961

    Related guide: How-to-Clone-an-Existing-Form-from-a-URL 

  • AZDBAdesze
    Replied on December 25, 2017 at 2:51 AM

    So the 50 was just an example.  

    I looked at your form but no Total amount can back. 

    This is what I looking for the calculation to do. 

    650+650+250+100 = 1,550 the lowest amount of the four options is not calculated 

    650+250+50+100 = 1,000 the lowest amount of the four options is not calculated

    So no matter how many options the user chooses out of the four options the calculations should look for the lowest amount and subtract it from the overall total. Thank of it as buy three and get the third one free, but the free is the lowest price point. 

    So that is what I am not seeing in your response or on the form.

    I know it is complex. 


    Merry Christmas 




  • Ardian_L
    Replied on December 25, 2017 at 4:30 AM

    It is possible to use the min() function, please check the demo form I have created below: https://form.jotform.com/73582376165969

    So it will automatically find the minimum value and will pick that one. This is the only option to use the min function. You can clone this form and modify it based on your needs. Please let us know if you have any other question.

    1514194238minFunc Screenshot 10

  • AZDBAdesze
    Replied on December 25, 2017 at 5:51 AM

    Ardian_L

    Ok you have given the best solution, but when I cloned the form the results came back weird.  Then I added more options to see how the form would behave and it didn't like it so what else did you do? 

    I copied to link of your cloned form. 

    I could not tell what the symbol is on the Lowest value after each value. 

    https://form.jotform.com/73582015284153


  • TREVON
    Replied on December 25, 2017 at 7:14 AM

     Kindly try cloning this form. It will give you lowest value of selected Check boxes. Kindly note that if one checkbox is not selected the value is 0 hence you must at least select all the check boxes and it will display the lowest figure in the selection.

    Kindly see below the calculation used to display minimum value

    1514204052Calculations min() Screenshot 10

  • AZDBAdesze
    Replied on December 26, 2017 at 1:43 AM

    I don't understand what Trevon is telling me. 

    Ardian_L you gave me the best solution, but when I cloned the form the results came back weird.  Then I added more options to see how the form would behave and it didn't like it so what else did you do? 

    I copied the link of your cloned form. 

    I could not tell what the symbol you used on the Lowest value after each option on the Form Calculation Widget. 

    https://form.jotform.com/73582015284153

    I need someone that can help like Ardian_L did. Thank you. 




  • BJoanna
    Replied on December 26, 2017 at 2:25 AM

    The result is not correct on your cloned form because the new options that you added are not separated correctly. A comma should be set as a number and not as a string. To resolve this issue simply click on each comma that you added inside of the calculation that you set. 

    1514272526calcualtion Screenshot 10

    Here is my cloned form: https://form.jotform.com/73590999231973 


    Please note that with the solution my colleague provided you, the lowest value will be calculated only when all options are selected.

  • AZDBAdesze
    Replied on December 26, 2017 at 3:30 AM

    Thank BJoanna

    I was able to achieve what I needed by coming up with a new solution. 

    I am still working on what you and your colleague have provided.  I appreciate the teams helps.

     Merry Christmas!!!


  • Elton Support Team Lead
    Replied on December 26, 2017 at 3:59 AM

    We are happy to hear it. Just let us know whenever you need assistance.

    Merry Christmas! :)

  • AZDBAdesze
    Replied on October 30, 2023 at 12:46 AM

    Hello team,


    I am trying to get the form  https://form.jotform.com/73590999231973  from this conversation. Can you assist?

  • Israel JotForm Support
    Replied on October 30, 2023 at 2:57 AM

    Hello AZDBAdesze,

    Thanks for getting back to us. It seems that the form has been deleted already by the owner. Could you let us know more details of your concern or what you want to achieve so that we can assist you?

    Once we hear back from you, we'll be able to help you with this

  • AZDBAdesze
    Replied on October 30, 2023 at 2:17 PM

    Can the content be recreated? As I want to use it again. See the solution for the problem I was trying to solve.

  • Mightor JotForm Support
    Replied on October 30, 2023 at 6:42 PM

    Hi AZDBAdesze, 

    Thanks for getting back to us. You will have to recreate the steps that our colleagues has given previously to create the form that you need. Or you can look in your account for the old form that you used previously and clone it to create a new form. If you run into an issue, take a screenshot of the page and give us details about the problem, so we can check it further.  This guide will show you how to add a screenshot in your reply:

    1. Click the Add Image icon.
    2. A. Paste the Image URL.
      B. Click Drop an Image or click to select to upload the image from your computer.
    3. Click the Add button to include the image in your reply.

    How can I conditionally subtract the lowest value when selected options is more than 4 Image 1 Screenshot 20

    Let us know if you have any other questions.

  • AZDBAdesze
    Replied on October 31, 2023 at 3:07 PM

    I am a little annoyed that no one is reading each others notes.

    Customer service is really lacking. Can I get second level support? Or someone who is willing to read through the transcript.

    We can live chat if necessary.


  • Victorino_S JotForm Support
    Replied on October 31, 2023 at 6:40 PM

    Hi AZDBAdesze, 

    Thanks for getting back to us. I’ll need a bit of time to look into this. I’ll get back to you as soon as I can.

  • Victorino_S JotForm Support
    Replied on October 31, 2023 at 7:27 PM

    Hi AZDBAdesze, 

    Thanks for patiently waiting. I recreated the form based on how the previous colleague set it up. You can view my demo form and clone it.

    Please note that the lowest value will be calculated only when all options are selected. If one of the options is not selected, the lowest number will be 0 because the unselected option will produce a 0 value by default. Check out my screencast below to see my result:

    How can I conditionally subtract the lowest value when selected options is more than 4 Image 1 Screenshot 20

    Give it a try, and let us know how it goes.

  • AZDBAdesze
    Replied on October 31, 2023 at 8:17 PM

    Thank you

    Victorino_S for reading and building what was there. appreciate you. I can move forward now.