Jump to content
  • 0
PackDaddy

Front end calculations

Question

I'm wondering if there is a way for a calculation to be done after an entry is made by a user on the front end of the site. 

Example: What is the weight of these 3 objects on Mars or the moon

I have 3 values for weight: 10lbs, 20lbs, 30lbs
I have 3 calculations for a planet/moon: Earth (just uses the original weights), moon (Weights*16.5%), Mars (Weight*38%)

I'd like to have a person use a drop down menu to choose either earth (default) moon, or mars and the weights would change on the front end based on the calculation

I also can't just make all 9 calculations on my sheet because on my actual spreadsheet there will be hundreds of entries that I don't want to replicate, and also, both the values and calculations can change.

Thank you

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

On a submission DataPage, where the user adds value for the field you want to save the calculation value in you, can select  "Calculated Value". Create your formula there and for the selected values on the for select the fields from the picker that looks like an arrow key facing down

Share this post


Link to post
Share on other sites
  • 0
On 3/31/2019 at 4:07 AM, PackDaddy said:

I'm wondering if there is a way for a calculation to be done after an entry is made by a user on the front end of the site. 

Example: What is the weight of these 3 objects on Mars or the moon

I have 3 values for weight: 10lbs, 20lbs, 30lbs
I have 3 calculations for a planet/moon: Earth (just uses the original weights), moon (Weights*16.5%), Mars (Weight*38%)

I'd like to have a person use a drop down menu to choose either earth (default) moon, or mars and the weights would change on the front end based on the calculation

I also can't just make all 9 calculations on my sheet because on my actual spreadsheet there will be hundreds of entries that I don't want to replicate, and also, both the values and calculations can change.

Thank you

Hi @PackDaddy,

I've created a sample Datapage with your workflow so that you can download and import it to your account so that you can see how it works. Please see the attached file

Earth

image.png.eb346dd590813814db8ee6d8d07c1d2b.png

Moon

image.png.bf0f4cffca2fe95009dbaac78af73c52.png

MARS

image.png.d4774e8de7b5b61e94150ebc80d78bdf.png

What I did are the following:

1. I've created virtual fields to allow the user to enter the weight of each the objects, and allow them to select the Space Object (Earth, Moon, Mars)

image.png.419b82e7d21e24d99e540099eb8f8fdd.png

2. Then I've created an HTML block to display the message

image.png.738b6491d1d52650e25e1cef891e0496.png

3. After that, I've added the fields from my table that will get its value from the user input.

image.png.4a9d7e583122fa6f4106cccea1bd1ae9.png

Here is the sample Case WHEN statement

CASE

WHEN '[@cbParamVirtual1]' = 'Earth' THEN [@cbParamVirtual2]

WHEN '[@cbParamVirtual1]' = 'Moon' THEN [@cbParamVirtual2] * 0.165

WHEN '[@cbParamVirtual1]' = 'Mars' THEN [@cbParamVirtual2] * 0.38

END

I hope this helps.

Regards,

TsiBiRu

CaspioData_2019-Apr-02_2241.zip

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...