Expand my Community achievements bar.

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

If then : then use x else users input

Avatar

Level 1

Is there a way in Formcalc to set the following if then statement?

if ((RoadBlocks == 1) & (a == 12))
then rb*7500
elseif (HasValue(a) and ((a >= 13) and (a <= 21)) and (RoadBlocks == 1))
then b
else
(actual user input in field)
endif

If all above statments are false, I would like the user to be able to enter something in that field.

1 Reply

Avatar

Level 10

Hi,

I hope I understood, what you trying to do.

Assumed you have the fields (RoadBlocks, a, b, rb and UserInput) then the script would look like:

if (RoadBlocks eq 1 and a eq 12) then

$ = rb * 7500

elseif (RoadBlocks eq 1 and Within(a, 13, 21) eq 1) then

$ = b

else

$ = UserInput

endif