# Condition on form field issue

**URL:** https://forum.mautic.org/t/condition-on-form-field-issue/29383
**Category:** Product Support
**Created:** [September 21, 2023, 10:08am UTC](https://forum.mautic.org/t/condition-on-form-field-issue/29383 "2023-09-21T10:08:51Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![tmahe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/tmahe/32/10117_2.png) [@tmahe](https://forum.mautic.org/u/tmahe)
#### Post date: [September 21, 2023, 10:08am UTC](https://forum.mautic.org/t/condition-on-form-field-issue/29383/1 "2023-09-21T10:08:51Z")

</div>

My Mautic version is: 4.4.10 up to date  
My PHP version is: 7.4.33  
My Database type and version is: MariaDB

Hello to evryone and thank for this wonderful tool I am using since 6 month !

I explain you my issue 🙂  
i wor for a van rental company in France ([sea-van.com](http://sea-van.com)) and we offer one of our 7 road books in pdf for every newsletter subscription (form here : [https://sea-van.com/inscription-newsletter-seavan/](https://sea-van.com/inscription-newsletter-seavan/))  
First I made a form in Mautic easy

Then a made a campaign :  
Condition : If form field “road book equals Bordeaux” send email Roadbook Bordeaux  
If not Condition “form field=Normandie” send email Roadbook Normandie…  
Et caetera…

It didn’t work so I tried other operators like “contain” or “begin with” → didnt work  
So I build a campain for each roadbook so that it is easy to debug… I did not find the bug  
Last solution instead of sending the mail I tried to put tags on the contacts… didnt work…

Maybe I am completely wrong, if someone could help me it wille be great !

---

<div class="post-metadata">

### Author: ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)
#### Post date: [September 21, 2023, 12:46pm UTC](https://forum.mautic.org/t/condition-on-form-field-issue/29383/2 "2023-09-21T12:46:28Z")

</div>

Your 1st set up should have worked.

Are your cron jobs configured correctly?

Did you test while logged out of mautic?

Can you share a screen grab of your campaign and how you configured the condition check node and the email send node.

Also the event history of the contact you have been testing with.

---

<div class="post-metadata">

### Author: ![tmahe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/tmahe/32/10117_2.png) [@tmahe](https://forum.mautic.org/u/tmahe)
#### Post date: [September 21, 2023, 4:33pm UTC](https://forum.mautic.org/t/condition-on-form-field-issue/29383/3 "2023-09-21T16:33:52Z")

</div>

Hello robm  
Thanks for this quick answer  
My cron jobs seem to be OK, other campain work great  
I will test while logged out

here is my form

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/c/c9524cd2000b6877a224a54eea78ec1d25e53e33.png)

campain  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/5/5aa2d96bc776380f06880d10fa54f49f76fa3a26.png)

node condition check node  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/5/5ac1822bbabb91c6feda8798d98b6a4e67d443d4.png)

node send email  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/e/e0e1968bdaa040858b55d17f9819705f86ba551a.png)

I will make some other tests and come back to you.  
Thanks a lot !!

---

<div class="post-metadata">

### Author: ![tmahe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/tmahe/32/10117_2.png) [@tmahe](https://forum.mautic.org/u/tmahe)
#### Post date: [September 21, 2023, 4:51pm UTC](https://forum.mautic.org/t/condition-on-form-field-issue/29383/4 "2023-09-21T16:51:27Z")

</div>

So I have news  
I tried to ask for the second roadbook Bordeaux,  
and I received the first one “Normandie”  
Log from my user

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/f/ffb37eb7b0c0de341e029ed300d7050ffb112d10.png)

it acts as if my first condition were true, but it should not because “ask roadbook” was not equal to “Normandie”

I hope I am clear enough

Maybe it is an issue with the space between letters ?  
The condition is not repected, very weird 🫣

---

<div class="post-metadata">

### Author: ![tmahe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/tmahe/32/10117_2.png) [@tmahe](https://forum.mautic.org/u/tmahe)
#### Post date: [September 21, 2023, 4:55pm UTC](https://forum.mautic.org/t/condition-on-form-field-issue/29383/5 "2023-09-21T16:55:31Z")

</div>

My contact test have the form field set to Bordeaux

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/5/5a359c3e18e3d3ab29163d630c07ad235cc70149.png)

My problem comes from the conditional node

---

<div class="post-metadata">

### Author: ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)
#### Post date: [September 22, 2023, 7:13am UTC](https://forum.mautic.org/t/condition-on-form-field-issue/29383/6 "2023-09-22T07:13:55Z")

</div>

All looks good, although my non existent French means I might be missing something.

But this should work as expected.

It looks like you are starting the campaign with the submission of a campaign form. Try use a standalone form and push contacts to a segment as a submit action. Also map the Roadbook form field to a custom field. Then in the campaign check for the custom field value as a condition rather the form field and see if that approach works.

---

<div class="post-metadata">

### Author: ![tmahe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/tmahe/32/10117_2.png) [@tmahe](https://forum.mautic.org/u/tmahe)
#### Post date: [September 22, 2023, 4:03pm UTC](https://forum.mautic.org/t/condition-on-form-field-issue/29383/7 "2023-09-22T16:03:24Z")

</div>

Hello Rob,  
I test your solution with an independant form and it worked !!!  
👌  
Thanks a lot !!  
Now I have an other issue because the contact won’t receive anything if they already are in the segment, and it can be the case.  
If you know a trick to avoid this ?  
Merci 😉

---

<div class="post-metadata">

### Author: ![tmahe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/tmahe/32/10117_2.png) [@tmahe](https://forum.mautic.org/u/tmahe)
#### Post date: [September 22, 2023, 4:08pm UTC](https://forum.mautic.org/t/condition-on-form-field-issue/29383/8 "2023-09-22T16:08:20Z")

</div>

I tried this as an action in the form  
unset segment  
set segment…  
Not sure it can work

---

<div class="post-metadata">

### Author: ![tmahe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/tmahe/32/10117_2.png) [@tmahe](https://forum.mautic.org/u/tmahe)
#### Post date: [September 23, 2023, 9:17am UTC](https://forum.mautic.org/t/condition-on-form-field-issue/29383/9 "2023-09-23T09:17:14Z")

</div>

Hello there !  
Everythings works fine with this solution, people can re-enter the campain because the segment is first unset and then set.  
Mautic is GREEEEEAAAAAAAAT !!! 🙃  
You can close this topic because it is SOLVED  
Thanks to ROB !!!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)
#### Post date: [September 24, 2023, 9:18pm UTC](https://forum.mautic.org/t/condition-on-form-field-issue/29383/10 "2023-09-24T21:18:10Z")

</div>

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