Acf checkbox field with gravity form + custom post type


To explain the situation a bit, I have a gravity form on one page. And when I fill out this form, it automatically creates a content type for me that contains ACF fields (with the gravity form plugin + custom post type). For basic fields like text, text editor etc, that’s all good.

Except that with the acf checkbox field, it is impossible to populate it.

To explain to you :
I created a checkbox field with 3 values:

  • sport
  • shoe repair
  • home appliance

If the user selects 1 choice, it works fine. However, if the Internet user makes 2 choices, the ACF field is not supplied.

Knowing that in the settings to associate an ACF field with a value of the form field. I only have “the field name (selected)” as if the word selected meant “selected only 1 choice” when it is a checkbox

Thank you in advance for your answer

I remain available in case of questions

Gravity Forms doesn’t provide any built-in support for ACF, are both are using different ways of storing the field values. For example for a checkboxes Gravity Forms stores the choices as comma separated plain text value, while ACF saves them as a serialized value.

This means most of the time you need to use custom code to alter the way the field value is saved to your ACF custom field to make ACF “understand” what was saved.

Using GF core Post Fields you can use the following filter to run your custom code for the value conversion: gform_after_create_post - Gravity Forms Documentation

There’s an example for ACF checkboxes.

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