Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

formcalc help - trying to mulitply or divide based on drop down list

Avatar

Former Community Member

So I am a complete noob at this and slowly learning Livecycle.

I have tried to make this formcalc script but its all wrong I'm sure.  I have a drop down list with 3 variables (annually, quarterly, monthly) i need to take the amount in "amount given" box and based on the 3 variables come up with the monthly amounts.

if (Giving Regularity == "Annually") then

Amount Given/12

else

if (Giving Regularity == "Quarterly") then

Amount Given/3

else

if (Giving Regularity == "Monthly") then

Amount Given*1

endif

I am sure this is very basic, but I would appreciate any tips from you pros.

Capture.PNG

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi there,

Make sure you are calling your objects with the right names...

Object names cannot have spaces, so when you are specifying "Given Regularity" or "Amount Given", both are wrong...

make sure to reference these values to the right objects

If you are not sure how to call these objects, you can always use the functionality of LiveCycle with Ctrl + Click on the object...

E.g.:

Make sure your cursor is in the Code Editor, while holding Ctrl, put your mouse over the object wanted, you should see your mouse change for an arrow pointing down, then click the left button on your mouse (still while holding down Ctrl)

In your editor, you should see the reference to the object that you want to retrieve the value from, this is how you should call your object

I hope this will help!

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi there,

Make sure you are calling your objects with the right names...

Object names cannot have spaces, so when you are specifying "Given Regularity" or "Amount Given", both are wrong...

make sure to reference these values to the right objects

If you are not sure how to call these objects, you can always use the functionality of LiveCycle with Ctrl + Click on the object...

E.g.:

Make sure your cursor is in the Code Editor, while holding Ctrl, put your mouse over the object wanted, you should see your mouse change for an arrow pointing down, then click the left button on your mouse (still while holding down Ctrl)

In your editor, you should see the reference to the object that you want to retrieve the value from, this is how you should call your object

I hope this will help!

Avatar

Former Community Member

Thank you for your help.  That was the problem along with the space i put between "ifelse".  Thanks for your time!