# Problem with conditional logic in campaign depending on checkbox in form

**URL:** <https://forum.mautic.org/t/problem-with-conditional-logic-in-campaign-depending-on-checkbox-in-form/18763>\
**Category:** Product Support\
**Created:** [March 29, 2021, 11:25pm UTC](https://forum.mautic.org/t/problem-with-conditional-logic-in-campaign-depending-on-checkbox-in-form/18763 "2021-03-29T23:25:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mneumann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mneumann/32/2512_2.png) [@mneumann](https://forum.mautic.org/u/mneumann)\
**Post date:** [March 29, 2021, 11:25pm UTC](https://forum.mautic.org/t/problem-with-conditional-logic-in-campaign-depending-on-checkbox-in-form/18763/1 "2021-03-29T23:25:01Z")

</div>

**Your software**  
My Mautic version is: 3.3.2  
My PHP version is: 7.3.27  
My Database type and version is: MySQL

**Your problem**  
My problem is:  
I have made a campaign with the objective to add a subscriber to a segment based on whether a checkbox was clicked on the subscription form. In the campaign I have put a condition, where I check whether the field has the checkbox value. Just the return is always positive, whether the box is checked or not. What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [March 30, 2021, 6:49am UTC](https://forum.mautic.org/t/problem-with-conditional-logic-in-campaign-depending-on-checkbox-in-form/18763/2 "2021-03-30T06:49:05Z")

</div>

How many values/options do you have in specific field ?  
How is the field defined ?  
Does the field have a default value ?

---

<div class="post-metadata">

**Author:** ![mneumann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mneumann/32/2512_2.png) [@mneumann](https://forum.mautic.org/u/mneumann)\
**Post date:** [April 11, 2021, 11:05pm UTC](https://forum.mautic.org/t/problem-with-conditional-logic-in-campaign-depending-on-checkbox-in-form/18763/3 "2021-04-11T23:05:45Z")

</div>

There is one checkbox to opt in to one additional list. Yes I found that the default value was set. It did not show at the check box on the front end, but it saved the same value, whether the box was checked or not. I removed that, and it is working. So it seems I having a checkbox being checked by default does not work?

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [April 12, 2021, 6:25am UTC](https://forum.mautic.org/t/problem-with-conditional-logic-in-campaign-depending-on-checkbox-in-form/18763/4 "2021-04-12T06:25:45Z")

</div>

not sure I fully understood the end of your sentence, but if all is working now that is good.

If you have a default value put into your custom field, then it will always take that value if the field is left blank

---

<div class="post-metadata">

**Author:** ![mneumann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mneumann/32/2512_2.png) [@mneumann](https://forum.mautic.org/u/mneumann)\
**Post date:** [April 14, 2021, 2:11pm UTC](https://forum.mautic.org/t/problem-with-conditional-logic-in-campaign-depending-on-checkbox-in-form/18763/5 "2021-04-14T14:11:07Z")

</div>

What I am saying, if the default value is the checkbox checked, than it should also show the checkbox checked in the form. Or is there any other way to display a checkbox as checked by default?

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [April 14, 2021, 5:53pm UTC](https://forum.mautic.org/t/problem-with-conditional-logic-in-campaign-depending-on-checkbox-in-form/18763/6 "2021-04-14T17:53:28Z")

</div>

there is a way to prefill the default value, when you setup the field you can add it there

---

<div class="post-metadata">

**Author:** ![mneumann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mneumann/32/2512_2.png) [@mneumann](https://forum.mautic.org/u/mneumann)\
**Post date:** [April 15, 2021, 12:01am UTC](https://forum.mautic.org/t/problem-with-conditional-logic-in-campaign-depending-on-checkbox-in-form/18763/7 "2021-04-15T00:01:10Z")

</div>

In the option list I see only the definition of the label and the resulting value. Where do I define whether the box should be checked by default?
