The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group

Slack Signup
Newsletter Optin
Help Desk

Calculating within form

Labels

This Discussion is public

Notifications

Hello,

I'm creating a form and am not sure how to do something. I'll try to explain.

Field 1 = number field, you have to write the number. I want to perform a calculation with the number in field 2. That works.

Also the number needs to be checked in a table with different values.  I tried to do the following

field 3: Created a table with multiple choice and different values:

150            52
151             53
152            54

If 151 is written in field 1, I need to perform another calculation with the value 53.

How can I do that ?

Is this a logical way to create a table with values ? I hope to hear suggestions.

with kind regards,

Aad

 

Hi Aad,
If I understand correctly, field3 is some sort of lookup table. Best way to do it is to create another form for the lookup table with "key" and "value" columns - e.g. 151 is key and 53 is value.

Now in your first form, change Field 1 to a Lookup field type pointing to lookup form --> key column. You could have this as a dropdown or textbox

Then create a new number field and in the settings, enable "Lookup value" --> "Dynamically retrieve the value from a Lookup field". In "Get value from", specify lookup form --> value column. In "Watch Lookup fields", set field 1 to watch. If you don't want users to see this new field, you could use a "Hidden" field or use any field types but set its visibility to "Administrator"

Now whenever the user selects or types a value in Field 1, new number field will automatically get "lookup value". You can use its value for your calculations in other fields.

The advantage of this approach is you can independently maintain lookup table and also reuse it everywhere.

You can read about Lookup fields here. https://formidableforms.com/knowledgebase/lookup/

Hope this help.

Hi Sujee,

thanks for your answer, but I'm doing something wrong or just don't get it.

I created a second form, with the radio button field I created a table.

In form 1, my first question is a lookup field, displayed as a textline.

How can I point it towards the table? The only thing I can change is: search value from...., not point it towards the "key" column in the other form.

The field in which I need the answer ( value) I selected as a number field and dynamically retrieve the value. There I can select the form I made, but not the table, nothing is there. If I change the table field to Lookup, no  individual values can be put in.

What am I doing wrong?

thanks in advance.

with kind regards,

Aad

 

 

Hi Aad,

The lookup form should have two number fields (key and value) instead of the radio button. Then add entries to this form (filling both fields). You can either add entries using "Formidable" --> "Entries" in Wordpress admin backend or you can create a page for admin users to submit and manage entries in this form.

Now in your main form, configure the lookup field to point to "key" field and the 2nd field to dynamically retrieve the value from "value" column. Remember to add watch so it will be updated everytime first field is changed.

I've attached my example forms. You can import it to your site. The" lookup" form already has 3 entries in it. In "Calculation using lookup" form, when you enter "151" in the first field, you can see value 53 is auto-populated in the 2nd field. 3rd field shows a simple calculation using the value.

Sujeevan

 

For some reason, I can't attach my example forms. So I copied here. https://pastebin.com/8nB3KXWh
Get the content and save as a XML file and then import it in your formidable forms

Hi Sujee,

THANK YOU!!!

The forms you created as an example worked great. I'd never would have figured it out like this.

I tried to do it like in Excel, create a table and use a vertical lookup to get the values. Creating the link between the values as submissions of a form was new to me. Bit it did the trick.

I regularly checked the forms to see what I had to do and which type of field I needed. Once again, THANK YOU VERY MUCH..

with kind regards,

Aad

You are welcome Aad.
Lookup and Dynamic fields are two popular ways of linking forms and they are very powerful. You can learn about them in the documentation

https://formidableforms.com/knowledgebase/lookup/
https://formidableforms.com/knowledgebase/dynamic/
https://formidableforms.com/knowledgebase/dynamic-vs-lookup-fields/

Discussion closed.