Redirect user to a different form based on an answer to a field

  • lgmusic_database
    Asked on March 24, 2024 at 1:41 AM

    Hi,

    I have a form (https://www.jotform.com/build/240828910082152) that asks the user on the very last page how they want to pay to participate in a music program. They can choose to pay by check, by credit card, through a company donation portal or not pay at all. Right after these choices is a submit button. (If they choose credit card, I show a list of products and then they type in their credit card number.)

    I would like to allow customers to pay the total amount with a subscription. Can I take the calculated total and pass that to another form, IF, and only if, they chose "Pay via subscription" from the dropdown?

    I watched the tutorials on how to pass values from one form to another, but that assumes the 2nd form is launched EVERY TIME the submit button is pressed. I only want to launch a 2nd form when the user makes a specific selection in a dropdown. Is this possible?

    Thank you,

    Heather

  • Jeric JotForm Support
    Replied on March 24, 2024 at 2:21 AM

    Hi lgmusic_database,

    Thanks for reaching back to us. I assume you are passing the value from the Form Calculation widget to the target form. If yes, that is possible via URL parameter. If you only want the 2nd form to be loaded based on the answer from a field, we can do that through Change Thank You Page conditional logic. Let me show you how:

    1. On the Form Builder, click on Settings.
    2. On the menu on the left side, click on Conditions.
    3. Select Change Thank You Page.Redirect user to a different form based on an answer to a field Image 1 Screenshot 30
    4. Create the condition. In this example, if Email is filled, redirect them to the 2nd form. Enter the 2nd form URL with the parameter.
    5. After that, Click on Save.Redirect user to a different form based on an answer to a field Image 2 Screenshot 41

    Give it a try and let us know if you need more help.

  • lgmusic_database
    Replied on March 26, 2024 at 12:13 AM

    Thank you for the information.

    Is it possible to do both? Can I load a 2nd form based on a specific answer in the first form AND pass in a parameter from a calculation widget?

    Thank you,

    Heather

  • Jeric JotForm Support
    Replied on March 26, 2024 at 12:49 AM

    Hi Heather,

    Thanks for reaching back to us. Yes, it's possible. Simply generate the form URL of the 2nd form with query parameters with Form Calculation widget value. You can check this demo form. Please make sure to select Pay via subscription for How would you like to pay so you'll be redirected to the 2nd form which has the Form Calculation Value of the 1st form. Here's an example of the generated Form URL of the 2nd form with the query parameter that is used in the Redirect to a URL conditional logic.

    Redirect user to a different form based on an answer to a field Image 1 Screenshot 20You can check this guide on how to automatically pass form data another form.

    Let us know if you need more help.





  • lgmusic_database
    Replied on March 26, 2024 at 2:20 AM

    Thank you again. I feel like I'm really close, but I must be missing some detail.

    Form 1: https://www.jotform.com/build/240828910082152

    Form 2: https://www.jotform.com/build/240497330247153

    When I click submit on Form 1, I see the parameter being passed in the URL with the proper calculated value. But I'm not sure if I've set up Form 2 correctly to actually take that value. I've named the field the same variable, but the calculated amount doesn't appear. And then I'm not sure how to USE that actual value in the subscription set up.

    Can you tell what I've done wrong?

    -Heather

  • Waqas JotForm Support
    Replied on March 26, 2024 at 3:03 AM

    Hi Heather,

    Thanks for getting back to us. I checked your form, and it appears that you're using a form builder URL in it. Please try using the URL below for your condition.

    https://www.jotform.com/240497330247153?TotalContribution={TotalContribution}

    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. 

    Let us know if there's anything else we can help you with.


  • lgmusic_database
    Replied on March 26, 2024 at 10:13 AM

    Thanks for correcting the URL!

    I made that change. It launches form 2, but the "TotalContribution" box is empty, so I must be missing something else....

    Thank you for helping.

  • Bilal JotForm Support
    Replied on March 26, 2024 at 10:59 AM

    Hi Heather,

    Thanks for getting back to us. I cloned your form and tested out the form parameters. I was able to replicate the issue you are referring and I found the solution for it. You are passing the parameters as a string value in your numbers field. You either need to remove the "$" from your Total Contribution field or Change the Total Contribution field type to Short text in your payment form. Let me walk you through both options:

    1. Remove this $ sign in your Form Calculations:

    Redirect user to a different form based on an answer to a field Image 1 Screenshot 30

    OR

    1. Add a Short Text field in your Payment form so that it can accept a string value coming from the registration form.
    2. Change the Unique name of the Short Text field to TotalContribution.

    Redirect user to a different form based on an answer to a field Image 2 Screenshot 41

    Check out this guide on how to prepopulate form fields using URL parameters

    Give it a try and let us know if you need any other help.

  • lgmusic_database
    Replied on March 26, 2024 at 12:05 PM

    Ah! I see.

    Okay, one more step closer!  The value is being passed into the Total Contributions box. I want to spread that amount over 5 equal monthly payments. The form builder says I need a calculation widget to pre-load the subscription amount, but I want to pull it from the pre-filled TotalContribution box. So I'm stuck again.



  • Cyrus JotForm Support
    Replied on March 26, 2024 at 12:55 PM

    Hi Heather,

    Thanks for getting back to us. I’m sorry you're having issues with your form. Let me look into it and get back to you with a solution.

    Thanks for your patience.

  • Cyrus JotForm Support
    Replied on March 27, 2024 at 5:22 PM

    Hi Heather,

    We really appreciate your patience and understanding while we look into this. After investigating it, we found out that we can't pass a value to the product list field. It only works when the product field is set to a user-defined amount. Take a look at the screenshot below:

    Redirect user to a different form based on an answer to a field Image 1 Screenshot 20

    Reach out again if there’s anything else we can do for you.

  • lgmusic_database
    Replied on March 31, 2024 at 10:41 PM

    Hi,

    I didn't want to give up and I figured out a way to make this work. Thought I'd pass it back to you in case others need to do this as well. I would think this is a common request from customers -- to be able to sell products AND offer a subscription.

    I pass the TOTAL amount from the first form to the second form. Then I added a calculation widget to the second form to take the total (from the first form) and divide by 5 (for 5 equal payments). I pass that amount into the subscription box.

    You also have to pass in a valid email address as another parameter, or else it seems to fail. Maybe it needs that to email a receipt. I don't know. But otherwise, this works!

    -Heather

  • Rene JotForm Support
    Replied on March 31, 2024 at 10:47 PM

    Hi Heather,

    Thanks for getting back to us and for keeping us updated. It is good to know that this process met your requirements. We will surely pass the same setup to other users who might need the same sequence of the payment form.

    Let us know if there's anything else we can help you with.