# CustomFieldHelper - Error when trying to run conditional logic on custom field

**URL:** <https://forum.mautic.org/t/customfieldhelper-error-when-trying-to-run-conditional-logic-on-custom-field/18482>\
**Category:** Mautic 3 - Install/Upgrade Support\
**Created:** [March 8, 2021, 1:23pm UTC](https://forum.mautic.org/t/customfieldhelper-error-when-trying-to-run-conditional-logic-on-custom-field/18482 "2021-03-08T13:23:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![blackswan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/blackswan/32/934_2.png) [@blackswan](https://forum.mautic.org/u/blackswan)\
**Post date:** [March 8, 2021, 1:23pm UTC](https://forum.mautic.org/t/customfieldhelper-error-when-trying-to-run-conditional-logic-on-custom-field/18482/1 "2021-03-08T13:23:28Z")

</div>

> <https://github.com/mautic/mautic/issues/9760>
>
> Bug Description
> This is my first error message here, I hope I am doing everything right.
> We have a campaign that is not...

[2021-03-08 12:40:03] mautic.NOTICE: Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 1 passed to Mautic\LeadBundle\Helper\CustomFieldHelper::fieldValueTransfomer() must be of the type array, null given, called in /var/www/vhosts/domain.com/crm.domain.com/app/bundles/LeadBundle/EventListener/CampaignSubscriber.php on line 502 (uncaught exception) at /var/www/vhosts/domain.com/crm.domain.com/app/bundles/LeadBundle/Helper/CustomFieldHelper.php line 60 while running console command `mautic:campaigns:trigger`

[2021-03-08 12:40:03] mautic.WARNING: Command `mautic:campaigns:trigger` exited with status code 1

[2021-03-08 12:48:02] mautic.NOTICE: Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 1 passed to Mautic\LeadBundle\Helper\CustomFieldHelper::fieldValueTransfomer() must be of the type array, null given, called in /var/www/vhosts/domain.com/crm.domain.com/app/bundles/LeadBundle/EventListener/CampaignSubscriber.php on line 502 (uncaught exception) at /var/www/vhosts/domain.com/crm.domain.com/app/bundles/LeadBundle/Helper/CustomFieldHelper.php line 60 while running console command `mautic:campaigns:trigger`

[2021-03-08 12:48:02] mautic.WARNING: Command `mautic:campaigns:trigger` exited with status code 1

[2021-03-08 12:56:02] mautic.NOTICE: Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 1 passed to Mautic\LeadBundle\Helper\CustomFieldHelper::fieldValueTransfomer() must be of the type array, null given, called in /var/www/vhosts/domain.com/crm.domain.com/app/bundles/LeadBundle/EventListener/CampaignSubscriber.php on line 502 (uncaught exception) at /var/www/vhosts/domain.com/crm.domain.com/app/bundles/LeadBundle/Helper/CustomFieldHelper.php line 60 while running console command `mautic:campaigns:trigger`

[2021-03-08 12:56:02] mautic.WARNING: Command `mautic:campaigns:trigger` exited with status code 1

[2021-03-08 13:04:03] mautic.NOTICE: Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 1 passed to Mautic\LeadBundle\Helper\CustomFieldHelper::fieldValueTransfomer() must be of the type array, null given, called in /var/www/vhosts/domain.com/crm.domain.com/app/bundles/LeadBundle/EventListener/CampaignSubscriber.php on line 502 (uncaught exception) at /var/www/vhosts/domain.com/crm.domain.com/app/bundles/LeadBundle/Helper/CustomFieldHelper.php line 60 while running console command `mautic:campaigns:trigger`

[2021-03-08 13:04:03] mautic.WARNING: Command `mautic:campaigns:trigger` exited with status code 1

[2021-03-08 13:08:02] mautic.NOTICE: Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 1 passed to Mautic\LeadBundle\Helper\CustomFieldHelper::fieldValueTransfomer() must be of the type array, null given, called in /var/www/vhosts/domain.com/crm.domain.com/app/bundles/LeadBundle/EventListener/CampaignSubscriber.php on line 502 (uncaught exception) at /var/www/vhosts/domain.com/crm.domain.com/app/bundles/LeadBundle/Helper/CustomFieldHelper.php line 60 while running console command `mautic:campaigns:trigger`

[2021-03-08 13:08:02] mautic.WARNING: Command `mautic:campaigns:trigger` exited with status code 1

---

<div class="post-metadata">

**Author:** ![raian](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/raian/32/1139_2.png) [@raian](https://forum.mautic.org/u/raian)\
**Post date:** [May 26, 2021, 12:19pm UTC](https://forum.mautic.org/t/customfieldhelper-error-when-trying-to-run-conditional-logic-on-custom-field/18482/2 "2021-05-26T12:19:21Z")

</div>

I’m facing the similar issue on mautic version 3.2.5 & 3.3.3

env details  
mautic3.3.3  
php7.3  
mysql 8

mautic campaign workflow

source=campaign form–\> condition=checkcontact field–\> send email

error:

In CustomFieldHelper.php line 60:  
| [CRON]  
| [CRON] Type error: Argument 1 passed to MauticLeadBundleHelperCustomFieldHelper  
| [CRON] ::fieldValueTransfomer() must be of the type array, null given, called in /  
| [CRON] var/www/html/app/bundles/LeadBundle/EventListener/CampaignSubscriber.php on  
| [CRON] line 502

@dennisameling@ekke

---

<div class="post-metadata">

**Author:** ![Diletec](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/diletec/32/4432_2.png) [@Diletec](https://forum.mautic.org/u/Diletec)\
**Post date:** [June 7, 2021, 2:44pm UTC](https://forum.mautic.org/t/customfieldhelper-error-when-trying-to-run-conditional-logic-on-custom-field/18482/3 "2021-06-07T14:44:37Z")

</div>

Hello!  
I’m facing the similar issue on mautic version 3.3.3

---

<div class="post-metadata">

**Author:** ![Diletec](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/diletec/32/4432_2.png) [@Diletec](https://forum.mautic.org/u/Diletec)\
**Post date:** [June 7, 2021, 2:53pm UTC](https://forum.mautic.org/t/customfieldhelper-error-when-trying-to-run-conditional-logic-on-custom-field/18482/4 "2021-06-07T14:53:27Z")

</div>

I believe this bug will be fixed in the next version.

> <https://github.com/mautic/mautic/issues/9760>
>
> \[//\]: # ( Invisible comment: 
> IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII…I
> Before you create the issue:
> IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
> Search for similar report among other reported issues.
> Learn how to troubleshoot at https://www.mautic.org/docs/en/tips/troubleshooting.html
> Use drag&drop to attach images or other files )
> 
> \## Bug Description
> This is my first error message here, I hope I am doing everything right.
> We have a campaign that is not running as it should. Apparently there is a problem with the conditions. Our condition is that a contact of a segment is in a certain industry (Company Field -\> Industry). This does not work but acknowledged with an error.
> Since it doesn't work with the Industry field, we set up another Custom Field, but this generates the same error.
> 
> | Q | A
> | --- | ---
> | Mautic version | 3.3.1
> | PHP version | 7.3.27
> | Browser | 
> 
> \### Steps to reproduce
> 1. Create several conditions
> 2. 
>  
> \### Mautic Error Log
> \[2021-03-08 10:15:01\] mautic.NOTICE: Symfony\\Component\\Debug\\Exception\\FatalThrowableError: Type error: Argument 1 passed to Mautic\\LeadBundle\\Helper\\CustomFieldHelper::fieldValueTransfomer() must be of the type array, null given, called in /var/www/vhosts/werocktools.com/oi.werocktools.com/app/bundles/LeadBundle/EventListener/CampaignSubscriber.php on line 502 (uncaught exception) at /var/www/vhosts/werocktools.com/oi.werocktools.com/app/bundles/LeadBundle/Helper/CustomFieldHelper.php line 60 while running console command \`mautic:campaigns:trigger\` \[\] \[\]
> \[2021-03-08 10:15:01\] mautic.WARNING: Command \`mautic:campaigns:trigger\` exited with status code 1 \[\] \[\]
> 
> \### Cron Job Error Log
> PHP Notice: Undefined index: industry\_custom\_field in /var/www/vhosts/werocktools.com/oi.werocktools.com/app/bundles/LeadBundle/EventListener/CampaignSubscriber.php on line 502
> 
> In CustomFieldHelper.php line 60:
>                                                                                
> Type error: Argument 1 passed to Mautic\\LeadBundle\\Helper\\CustomFieldHelper  
> ::fieldValueTransfomer() must be of the type array, null given, called in /  
> var/www/vhosts/werocktools.com/oi.werocktools.com/app/bundles/LeadBundle/Ev  
> entListener/CampaignSubscriber.php on line 502                               
>                                                                                
> 
> mautic:campaigns:trigger \[-i|--campaign-id \[CAMPAIGN-ID\]\] \[--campaign-limit \[CAMPAIGN-LIMIT\]\] \[--contact-id \[CONTACT-ID\]\] \[--contact-ids \[CONTACT-IDS\]\] \[--min-contact-id \[MIN-CONTACT-ID\]\] \[--max-contact-id \[MAX-CONTACT-ID\]\] \[--thread-id \[THREAD-ID\]\] \[--max-threads \[MAX-THREADS\]\] \[--kickoff-only\] \[--scheduled-only\] \[--inactive-only\] \[-l|--batch-limit \[BATCH-LIMIT\]\] \[-f|--force\] \[--bypass-locking\] \[-t|--timeout TIMEOUT\] \[-x|--lock\_mode LOCK\_MODE\] \[-h|--help\] \[-q|--quiet\] \[-v|vv|vvv|--verbose\] \[-V|--version\] \[--ansi\] \[--no-ansi\] \[-n|--no-interaction\] \[-e|--env ENV\] \[--no-debug\] \[--\] \<command\>
> !\[Screenshot 2021-03-08 112257\](https://user-images.githubusercontent.com/73632724/110309358-26d4da00-7ff9-11eb-8993-582fe6c4e37f.jpg)
> 
> 
> 
> \[//\]: # ( Invisible comment:
> Please check for related errors in the latest log file in \[mautic root\]/app/log/ and/or the web server's logs and post them here. Be sure to remove sensitive information if applicable. )
> 
> 
> \<bountysource-plugin\>
> 
> \---
> Want to back this issue? \*\*\[Post a bounty on it!\](https://www.bountysource.com/issues/96997537-conditional-logic-generates-an-error-message?utm\_campaign=plugin&utm\_content=tracker%2F5355074&utm\_medium=issues&utm\_source=github)\*\* We accept bounties via \[Bountysource\](https://www.bountysource.com/?utm\_campaign=plugin&utm\_content=tracker%2F5355074&utm\_medium=issues&utm\_source=github).
> \</bountysource-plugin\>

---

<div class="post-metadata">

**Author:** ![raian](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/raian/32/1139_2.png) [@raian](https://forum.mautic.org/u/raian)\
**Post date:** [June 8, 2021, 6:06am UTC](https://forum.mautic.org/t/customfieldhelper-error-when-trying-to-run-conditional-logic-on-custom-field/18482/5 "2021-06-08T06:06:36Z")

</div>

[https://forum.mautic.org/t/mautic-campaign-doesnot-work/19628](https://forum.mautic.org/t/mautic-campaign-doesnot-work/19628)
