Using the values of checkbox options for conditional d [RESOLVED]

Hey community,

I am experiencing an issue with checkboxes and their values not behaving as I think they should with respect to conditional logic within the body of notification emails.

I have a checkbox with a single checkbox entitled “Are you a first-time member?” The checkbox label is set to “yes, I am a first-time member” - and the (separate) value of this option is “yes”.

In the notification body I have options based on whether this is checked or not.

[gravityforms action="conditional" merge_tag="{Are you a first-time member?:61}" condition="is" value="yes"]
This message is displayed when the checkbox has been checked.
[/gravityforms]
[gravityforms action="conditional" merge_tag="{Are you a first-time member?:61}" condition="isnot" value="yes"]
This message is displayed when the checkbox is not checked.
[/gravityforms]

But no matter the state of the checkbox on submission, it displays the second message, so the value of the checkbox or at least the thing I am comparing it to is not yes… so… I did some tests and… the only way I can seemingly detect for the checkbox being checked is:

[gravityforms action="conditional" merge_tag="{Are you a first-time member?:61.1}" condition="is" value="yes, I am a first-time member"]

I mean… I am glad I can finally detect the checkbox being checked… but I would prefer to use the actual value I set the checkbox option to, “yes,” in case the wording ever changes.

Is there a way I can use my less verbose value for the checkbox field, yes, in the notification conditional logic within my notification? It’s weird - I can output the checkbox normally in the notification and get “yes,” but not use this value as the comparison value in the conditional logic in the notification body!

Thanks in advance

You should be using the :value modifier on the merge tag:

[gravityforms action="conditional" merge_tag="{Are you a first-time member?:61:value}" condition="is" value="yes"]
This message is displayed when the checkbox has been checked.
[/gravityforms]
1 Like

Fantastic, thank you Karl. I did some tests and it works.

Very nice to not have to use verbose markup (which would be fragile markup, because checkbox labels/values may change in the future).

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.