-
Laurel_RidgeAsked on April 23, 2024 at 2:31 PM
We are creating a form for people to pay for spaces at our annual community yard sale. The spaces cost different amounts depending on a condition: community members pay $25.00 per space, but our College students/staff/faculty only pay $20 per space. I have a yes or no question set up for someone to indicate if they are a community member or College student/staff/faculty. Is there a way to conditionally format it so that by selecting "yes" on that question, the price of the product drops to $20.00? I'm open to any suggestions you have. I watched the video linked at https://www.jotform.com/widgets/calculation but couldn't figure out how to apply that to my situation.
Any help is appreciated.
Page URL: https://form.jotform.com/241135266747156 -
Ericson_B JotForm SupportReplied on April 23, 2024 at 3:10 PM
Hi Laurel,
Thanks for reaching out to Jotform Support. Unfortunately, we cannot conditionally adjust the prices of the products in the Product List. A workaround is to have two single-choice elements, assign a calculation value to each, and display the short texts based on the Yes or No options. We will then use User Defined Amount for your Square integration. Let me show you how:
- In Form Builder, select Add Form Element in the upper-left corner.
- In the Form Elements pane on the left, add 2 Short Texts.
- Select the Short Text's Gear icon to open properties.
- Scroll down and toggle Read Only.
Next, set up an Update/Calculate field condition so that when your form filler selects one of the Yes or No options, the amount is assigned to each short text.
- Go to Settings at the top.
- Select Conditions on the left.
- Add a new Update/Calculate Field condition.
Set up two conditions as shown below, and make sure that both amounts are set to string (grey color).
Then, set up a Show/Hide field condition so that when they select Yes or No, one of the short texts will appear along with the amount. You can refer to the condition screenshot above to see where to select the Show/Hide condition. Set up two conditions as shown below:
Following that, we'll include a Form Calculation widget to get the amount of both fields. To hide the widget, right-click on it and select Hide.
In the final step, we'll alter the Square integration to a user-defined amount and retrieve the pricing via the Form Calculation widget.
- Select the Wand icon to open the integration settings.
- Go to Payment Type and select User Defined Amount.
- Next, click Get Price From and select Total (Form Calculation Widget)
- Click Save to save the changes.
Here's my cloned form that you can test.
Give it a try and let us know if you have any other questions.
-
Laurel_RidgeReplied on April 26, 2024 at 2:03 PM
Thank you for this help. I'm stuck on this step: "Following that, we'll include a Form Calculation widget to get the amount of both fields. To hide the widget, right-click on it and select Hide. " Could you provide a screen shot of how to do that?
-
Neil JotForm SupportReplied on April 26, 2024 at 2:34 PM
Hi Laurel,
Thanks for getting back to us. Sure, let me show you how to do that:
- In Form Builder, click on Add Form Element.
- Then, go to the Widgets tab.
- Search for Form Calculation and click or drag it to your form.
- After that, right-click on the widget and select Hide so it won't be visible on the live form.
- Then, click on the wand icon to open its settings.
- Click on Add Field and add both the Community members and College student/staff/faculty fields.
- Make sure to add a plus sign between them and click on Save.
For the final step, you can refer to the steps given by my colleague above on how to change the payment type of the Square integration to User Defined amount and get the total pricing from the form calculation widget we've set up.
After that, you should be getting the same result:
You can also check the demo form here. Feel free to clone it to further test it. We have a guide here that you can check out on how to clone an existing form from a URL.
Give it a try and let us know if you need more help.
-
Laurel_RidgeReplied on May 3, 2024 at 7:45 AM
I seem to have set something up incorrectly with the calculations. It will calculate the number of spaces for our "College Student" option correctly, but for our "Community Member" option, it doesn't calculate anything. For example, some who marked "No" to being a student/faculty/staff and they enter that they want 5 spaces at $25, the calculation only shows they pay $25 instead of what should be $125. Any idea what I did wrong?
-
Eliza JotForm SupportReplied on May 3, 2024 at 8:38 AM
Hi Laurel,
Thanks for getting back to us. When I cloned and tested your form, the same thing happened for me. After investigating it a bit, I found a solution. Let me show you how. But first, let's remove the calculation you have within your Form Calculation widget:
- In Form Builder, click on the Form Calculation widget and click on the wand icon.
- Remove the fields within the box.
- Click on Save.
Next, let's set up Conditional Logic:
- Click on Settings in the orange navigation bar at the top part of the page.
- Go to Conditions, and click on Add Condition.
- Select Update/Calculate Field, and set the conditions as shown in the screenshot below/
- Click on Save.
Then, let's add another set of conditions:
- Click on Settings in the orange navigation bar at the top part of the page.
- Go to Conditions, and click on Add Condition.
- Select Update/Calculate Field, and set the conditions as shown in the screenshot below/
- Click on Save.
The screencast below shows how the conditions above are done:
Check out the screencast below to see my results:
You can also clone this Demo Form if you want.
Give it a try and let us know if you need any other help.