Creating a calculated field using a result from a lookup

By: Michael Jasper | Asked: 10/22/2024
ForumsCategory: General questionsCreating a calculated field using a result from a lookup
Michael Jasper asked 1 week ago
I have a form where the user selects a category, and two additional fields are populated based on the selection. These fields are text fields, but their contents are numeric. I built it this way while following a tutorial. I have tried making these numeric fields in both the user form and the form from which the data comes, but the results did not populate the lookup field, so I went back to text.   I am trying to use the lookup fields in a few calculations with no success.   The first formula adds the two lookup fields together but does not work The second calculated field multiplies a user input by a lookup field; this does not work either.  I have other calculated fields on the form that work properly; they do not use lookup fields.    Is there something that I am overlooking when using lookup fields?
2 Answers
Victor Font answered 1 week ago
It's impossible to know if you overlooked something without actually seeing what you've done. It shouldn't make a difference if the fields are numeric or text. Whether you realize it or not, all fields are text when stored in the database.
Mark HansenMark Hansen answered 1 week ago

In the fields that you want to see the calculated results, do you have it set to the "calculate" function versus text? If it's a text function, it will not function as a calculator.   

Victor Font replied 1 week ago

Good suggestion, Mark!

Michael Jasper replied 7 days ago

Thanks guys. One of the fields was a percent. I changed that to a decimal, and it worked fine. I appreciate the guidance!

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right