Allow for non-standard imported values for checkbox fields

Numbers screenshot showing checkboxes Normally, the imported value should match the checkbox input's value. If the checkbox in Gravity Forms has a value of "Apple", the imported cell value should also be "Apple". If the CSV value is "Apples" or "True" or "YES" or "1", the import will not check the checkbox in Gravity Forms. 

The Numbers app for Mac and iOS has checkbox cell formats (see screenshot). When exported to CSV, these checked or unchecked checkboxes are represented by "TRUE" or "FALSE" text values. If you are importing a CSV from Numbers that uses these special fields, then "TRUE" should be considered valid during import.

Allow any non-empty value to be valid

These following values will be interpreted as empty, and the checkbox will not be checked:

"" // Empty
"0" // Zero
"FALSE" // Upper-case "false"

Any other value will be interpreted as not empty, and the checkbox will be checked.

Enable the functionality

Have a column in your file for each checkbox option.

The checkbox options.

Each checkbox value must be mapped separately during the Import Entries configuration.

If the gravityview-importer/strict-mode/fill-checkbox-choices filter returns `true`, the correct value will be filled. See below code:

add_filter( 'gravityview-importer/strict-mode/fill-checkbox-choices', '__return_true' );

Read here how to add these code samples to your website: Where to put code samples.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us