Scientific calculator type application

Hello friends, I know my question might seem strange, since there are plenty of scientific calculators available on the internet (there's even a native one in Windows), but I'm thinking of integrating a calculator into an app I've created, so that users can "add" calculation expressions with the data they enter.

In some way, what I need is to create elements that the user can select and generate their own operations. I don't really know how it would work; it's simply an idea I have but have never put into practice. All the calculations I perform are pre-established in the apps, but it would be nice to have rheostats that allow the user to modify those calculations according to their needs.

Coming back to the "calculator" with AppSheet, I would appreciate it if someone could tell me (at least), "Your idea is not possible in AppSheet."

Greetings and have a good day.

Solved Solved
0 5 681
1 ACCEPTED SOLUTION

Since AppSheet does not allow you to dynamically configure the FORMULA of a column, the only way I can think of achieving dynamic calculation is to use a text field and and submit it via bot to an Apps Script to evaluate that text using eval() and return it to the row for display.

You can construct expressions using an ENUM column ("+", "-", "/", "*", "(", ")", etc) and an action button to update the above text field based on the selected ENUM value. (you can of course let the user directly write it out in the text field...)

As far as I see, this is impractical to say the least.

I am not sure how many variations of calculation logic your user requires, but if not many you can simply supply all them, not necessarily in separate fields but with an OPTION field and corresponding expression within a SWITCH statement.

View solution in original post

5 REPLIES 5

Since AppSheet does not allow you to dynamically configure the FORMULA of a column, the only way I can think of achieving dynamic calculation is to use a text field and and submit it via bot to an Apps Script to evaluate that text using eval() and return it to the row for display.

You can construct expressions using an ENUM column ("+", "-", "/", "*", "(", ")", etc) and an action button to update the above text field based on the selected ENUM value. (you can of course let the user directly write it out in the text field...)

As far as I see, this is impractical to say the least.

I am not sure how many variations of calculation logic your user requires, but if not many you can simply supply all them, not necessarily in separate fields but with an OPTION field and corresponding expression within a SWITCH statement.

Genius! I'll give it a try, my friend!! I'll keep in touch! Thank you!! @TeeSee1 

Friend, I wanted to let you know that I have decided not to do this as there are simpler ways to achieve what I need in my app. Thanks anyway.

Hi,

Can  you share the solution. I would like too create my own calculation too

Hi, I marked this as resolved to close the case since I couldn't delete the post. An internal dynamic calculation would be useful, but it's clear that AppSheet doesn't allow it. I resolved it externally; any calculation the user needs is done outside the app, the rest is done within the app. This simplified my work a lot and the user experience became more private.

Top Labels in this Space