How to Pass a Form’s Calculated Value to Another Form’s Payment Total Field

September 15, 2021

In case you’re not aware, you can pass a calculated value to a payment field’s total box. It’s discussed on this other guide: How to Pass a Calculation to a Payment Field. However, what if you want to pass the calculated value from one form to another form that has a payment integration? In this tutorial, you’ll learn how to pass a calculated value to the second form particularly on the Paypal payment field (donation or custom payment). Basically, this is a basic prepopulating method using URL parameters, which is similar to this guide: How to Automatically Pass Form Data to Another Form.

To start, you must have 2 different forms – Form 1 does the calculation and Form 2 is where the payment field will be populated. 

NOTE: You can only pass a calculated value to a payment field if its PAYMENT TYPE is set to either COLLECT DONATIONS or USER DEFINED AMOUNT.

Example:

Form 1 (Calculation) – https://www.jotform.com/41004751066950

Form 2 (Paypal form) – https://www.jotform.com/41004537068954

To pass the calculated value to the PayPal field on the second form, follow these steps.

STEP 1: Create the THANK YOU PAGE URL using the second form’s URL since Form 2 will serve as the thank you page of Form 1.

So, whenever the user submits the first form, they will be redirected to the second form with the payment field prepopulated.

Example:

https://www.jotform.com/41004537068954?myProducts3[price]=

Where:

🔘 https://www.jotform.com/41004537068954 is Form 2’s URL.

🔘 myProducts3[price] is the unique field name of the PayPal payment field on Form 2.

🔘 ? and = are constants. Without these, prepopulation won’t work so make sure to use the same format.

Here’s how to get the unique field name using the browser’s (Chrome’s) INSPECT ELEMENT feature. The field name is on the name attribute, right after the underscore.

1.1. First, view your form and right click on the PAYMENT FIELD.

1.2. Select INSPECT ELEMENT.

1.3. It should open the browser’s console and show you the field name.

In this case, it is q3_myProducts3[price] but we will only get the field name after the underscore, which is myProducts3[price].

STEP 2: Edit Form 1 in the form builder, get the unique field name of the field where the calculated value will come from and then append this tag to the THANK YOU PAGE URL constructed in the STEP 1.

Example:

https://www.jotform.com/41004537068954?myProducts3[price]={total}

Where:

{total} is the unique field name of the calculation.

2.1. Select the field and click the GEAR icon. Go to the ADVANCED tab and expand the FIELD DETAILS section.

2.2. Take note and copy the field’s UNIQUE NAME, which is {total}.

STEP 3: Set the constructed THANK YOU PAGE URL as Form 1‘s custom thank you URL.

3.1. Click SETTINGS at the top then THANK YOU PAGE on the left.

3.2. Choose REDIRECT TO EXTERNAL LINK. Paste the completed URL with parameters to fill out the second form.

https://www.jotform.com/41004537068954?myProducts3[price]={total}

Your changes will automatically be saved and you’re done. Go test your form!

Demo (submit this form to see how it works): https://www.jotform.com/41004751066950

Was this guide helpful?
Contact Support:

Our customer support team is available 24/7 and our average response time is between one to two hours.
Our team can be contacted via:

Support Forum: https://www.jotform.com/answers/

Contact JotForm Support: https://www.jotform.com/contact/

Send Comment:

JotForm Avatar
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Comment:

Podo CommentBe the first to comment.