Auto select the product options in the Product List based on the option selected in the Single Choice field

  • Finance VOX FM
    Asked on September 7, 2023 at 1:50 PM

    Hi, is it possible to integrate Single Choice option selected by user to auto select Product Option under payments? We need it in this way as Single Choice option need to recrod user selection on the form.

    If there is better way to achieve similar or same results please do advise.

  • Gilbert JotForm Support
    Replied on September 7, 2023 at 3:36 PM

    Hi there,

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

  • Gilbert JotForm Support
    Replied on September 7, 2023 at 4:12 PM

    Thanks for waiting.

    Unfortunately, it's currently not possible to automatically select a product option from the Product List based on the user's answer on certain fields. If you need to retain the Single Choice field to select the product options, you can just use regular fields like the Single Choice or Dropdown fields to display the product item and their options. Then, you can enable calculation values and pass the total price to the payment field.

    You can follow the steps below on how you can set this up on your form:

    1. Open your PayPal Integration settings and change the Payment Type to User Defined Amount. This will remove the products from the Product List but that's okay since we'll display them instead on regular form fields later. Click Save after that.

    Auto select the product options in the Product List based on the option selected in the Single Choice field Image 1 Screenshot 80

    2. Add basic form elements like the Dropdown field to display each product option in the Merchandises category. So it will be one Dropdown for each option. Add a Dropdown as well for the Donate option. Set the quantity as the dropdown options for the T-Shirt sizes. Then, the donation amounts for the Donate field.

    Auto select the product options in the Product List based on the option selected in the Single Choice field Image 2 Screenshot 91

    3. Enable Calculation Values on each dropdown field and set each quantity's prices as the value

    Auto select the product options in the Product List based on the option selected in the Single Choice field Image 3 Screenshot 102

    The same goes for the Donate dropdown field

    Auto select the product options in the Product List based on the option selected in the Single Choice field Image 4 Screenshot 113

    4. Next, add a Form Calculation widget which will be used to calculate the total and pass this value to the payment field. Open the Form Calculation widget's settings and add all the fields(product options) with calculation values and add a plus(+) sign between each of them to indicate that you want to get their sum. Click Save once you're done. You can hide that widget from the form.

    Auto select the product options in the Product List based on the option selected in the Single Choice field Image 5 Screenshot 124

    5. Go back to the PayPal Integration settings panel and set the Get Price From to the Form Calculation widget. Whatever is the total value calculated on the widget will be passed to the payment field which will serve as the total price

    Auto select the product options in the Product List based on the option selected in the Single Choice field Image 6 Screenshot 135

    Here's how it would all work in the form:

    Auto select the product options in the Product List based on the option selected in the Single Choice field Image 7 Screenshot 146

    This way, instead of auto-selecting the product options from the Product List, which is currently not possible, the user would just need to select the items directly on the single-choice, dropdown fields. Then, the total value will be passed to the payment field.

    Would this work for you? Here's the link to my demo form. You can clone it if you want to test it out or if you want to check its setup in the backend.

    Let us know if you have any other questions.