Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Calculation help needed

Avatar

Former Community Member
I need to do a pretty simple calculation based on input in another field.

I need to check the state input, and then calculate sales tax if the state is the required state.

I've tried:

If(txtState = "LA") then (numTotal*.04) else 0 endif



This is giving me a syntax error message. What do I need to do for this?

TIA-
1 Reply

Avatar

Level 7
You have to use the equality operator, "eq" or "==", for testing in a logical expression and you have to test either the "rawValue" or "formattedValue" property of the field.