Trying to figure out why my code is not working (only first section works but nothing beyond that) no errors given just not calculating.
=(
if FabricSelection = "GuilfordFR701" then TotalSquareFootageOfPanelsSelected* 0 else
if FabricSelection = "Guilford Anchorage" then TotalSquareFootageOfPanelsSelected * .5 else 0
)
+
EstimatedBasePriceOfPanels+
(
if PanelThickness = "1Inch" then TotalSquareFootageOfPanelsSelected* 0 else
if PanelThickness = "2Inch" then TotalSquareFootageOfPanelsSelected * 1.5 else 0
)
+
(
if HangingHardware = "ImpalingClips/Adhesive" then TotalSquareFootageOfPanelsSelected* 0 else
if HangingHardware = "ZClips" then TotalSquareFootageOfPanelsSelected * .5 else
if HangingHardware = "RotoFastSnapOn" then TotalSquareFootageOfPanelsSelected * .5 else 0
)
+
(
if EdgeDetail = "square" then TotalSquareFootageOfPanelsSelected* 0 else
if EdgeDetail = "radius" then TotalSquareFootageOfPanelsSelected * .5 else
if EdgeDetail = "bevel" then TotalSquareFootageOfPanelsSelected * .5 else
if EdgeDetail = "halfbevel" then TotalSquareFootageOfPanelsSelected * .5 else 0
)
Best Answer
Cognito Forms will validate that your calculations are syntactically correct, but depending on the data on your form they may not work the way you desire.
Without looking at your specific form, I suspect that your comparison values like
"1Inch"
and"RotoFastSnapOn"
are not correct. Unlike the names of your fields used in calculations, likeEdgeDetail
, these values in quotes are the actual values of your fields and may contain spaces, punctuation, etc. They are also case sensitive.So you may need to change your calculation from this:
HangingHardware = "RotoFastSnapOn"
to thisHangingHardware = "Roto Fast Snap On"
. Please mark this as the answer if correct or provide more details so we can assist your further!