What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.
We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.
Matrix Field: Value being passed during calculation is always 0.Asked by advantech on June 30, 2016 at 07:04 PM
I've been trying for a long time today to get this to work in its simplest form with no luck.
I have a radio check box question with 2 hidden answers. The columns have numeric values of 1-5 attached to them. When I tell logic:
IF Q1 = 1,2 THEN SHOW ANSWER A.
IF Q1 = 3,4,5 THEN SHOW ANSWER B.
Now I added a 2nd question. When I tell logic:
IF Q1 OR Q2 = 1,2 THEN SHOW ANSWER A.
IF Q1 AND Q2 = 3,4,5 THEN SHOW ANSWER B.
It keeps showing Answer B no matter what...even when nothing is checked. If 1 or 2 is checked, it does show Answer A, but also shows B.
Pulling my hair out!!!
Here's the form page address: https://form.jotform.com/61806654179969
correctly JotForm style hidden check
I cloned your form and I also encountered the same issue with the condition. It appears that the calculation values of the matrix field is not being read properly, which causes the condition based on the calculation values to not work correctly. Please allow me some time to investigate this issue further and I will get back to you once I have a workaround. Regards.
After further tests, I was able to confirm that the calculation values are not working correctly. In my test form, I tried to pass the calculation value form the matrix into a number field and a textbox. However, in both instances the value returned is always 0, and not the values that I have set.
I will have to escalate this issue to our backend team for further investigation. We will let you know on this thread once we have an update. Regards.
Thanks Christian. Thought I was going nuts. Any chance I can get an estimate on a response to this? I've been with you guys for years and it is difficult to tell a client that we're working on it but have no target date. They don't tend to like that. Thanks in advance.
I can see that assigning values to the matrix option is not working. Unfortunately, there isn't an estimated time-frame for a resolution.
But, it is possible to obtain the value from the options you have added through the hidden spans:
Simply add two Form Calculation widgets:
You will use then to obtain the values from each matrix: https://www.jotform.com/help/343-How-to-Perform-Form-Calculation-in-the-Matrix-Field
Then create the conditions to show the message fields depending on the results of each calculation widget:
You may clone my form and use it if you want to: http://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL
Let us know if you need more help.
I am finally back on this project with the same level of frustration as before. I made my form just the same way you did yours. https://form.jotform.com/61806654179969
However, with one minor difference you did not take into account. One of my statements is ALL and one is ANY. The logic is sound and should work, but for the ANY statement, it always shows the hidden field before anything is even entered. I am racking my brain and cannot understand how something so simple will not work. Lots of wasted time. Please help.
The only other difference is that my values are LESS THAN and GREATER THAN. Using individual number as you did will not work with the logic for the ALL condition.
Found the answer. In the calculator, under advanced options, you must check: Wait for input before including the field in calculation.
I am glad to know that you were able to resolve the issue. I checked your form and I can see that it is setup as you have stated. If you have any other concerns, feel free to contact us again. Cheers.
This bug is fixed. Thanks for your feedback.