How to change consent to boolean type (true/false)

Is their a way to change the consent to boolean type (true/false) instead of “Checked”?

Hi Barak. Can you explain your use case? Maybe it’s possible to change the value before sending it wherever it needs to be sent as TRUE/FALSE. Thank you.

Hi Chris,

I have the same request. I’m sending lead data to an existing CRM system that accepts only boolean as true/false.

Is there a solution for this?

Kind regards
Christian

Hi Christian. Depending on how you are sending the data to the CRM, you may be able to filter the value and change it before it is sent. With our add-ons, you can use this filter:

How are you sending the data to your CRM?

I’m using zapier and we have a consent field. Can you comment on how to update the 0/1 values to true/false? We’re using the most recent add-on. And I’m looking at these docs, but I’m not super clear on how it works. Thanks! https://docs.gravityforms.com/gform_zapier_field_value/

Yes, that is the correct filter to use. I worked up an example you can use for a consent field to change the ‘1’ to ‘true’ for Zapier:

Change the form ID from 74 to your form ID, and the field ID from 2 to your field ID. Note that the checkbox portion of the consent field is sub-part .1, so for field 2, that is 2.1. You will see this in the code in a couple places (three I think.)

That is PHP code which can be added to your theme functions.php file, or you can use a plugin such as this one to keep the code separate from the theme: Code Snippets – WordPress plugin | WordPress.org

If you have any trouble with the code, show me what you are using, and let me know the ID of the consent field in your form, and the form ID. Thank you.

Also, when configuring the Zap, be sure it is the Consent (consent) portion of the Consent field that you mapped to the CRM field where you need the boolean:

Thanks for this! I’ll try it out. -Dave

1 Like

Hi Chris, thanks for your reply :slight_smile:

We’re using the Webhooks Add-On and are sending to Integromat (far superior to Zapier, IMHO).

Form ID: 10
Consent field ID 1 (privacy) : 11.1
Consent field ID 2 (marketing) : 11.2

Thanks for your help, it’s very much appreciated!

Kind regards
Christian

Hi Christian. With the Webhooks Add-On, you can use the gform_webhooks_request_data() filter:

The process is about the same with a different filter.

© 2008 - 2021. Gravity Forms is a project by Rocketgenius Inc.