Title: Importing for checkbox values
Last modified: November 20, 2016

---

# Importing for checkbox values

 *  Resolved [Robin](https://wordpress.org/support/users/cinghaman/)
 * (@cinghaman)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/importing-for-checkbox-values/)
 * I have ACF fields to my listing CPT, and one of the fields have multi-select 
   checkbox values as full time, part time, self-study
    I have in my excelsheet 
   all these three values (full-time: no, part-time: no, self-study: yes and so 
   on for all the elements) How can I map these values so a correct checkbox is 
   checked when I do import

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/importing-for-checkbox-values/#post-8463940)
 * Hey [@cinghaman](https://wordpress.org/support/users/cinghaman/)
 * If you’re using our ACF add-on, then you’ll need to put the slugs of the checkboxes(
   separated by commas ) in the ACF field. Going based on your example string, a
   [custom PHP function in the import](http://www.wpallimport.com/documentation/developers/execute-php/)
   could be used to return the values – here’s an example snippet:
 *     ```
       function my_get_checkboxes( $data ) {
       	$data = explode( ",", $data );
       	$return = array();
   
       	if ( !empty( $data ) ) {
       		foreach( $data as $items ) {
       			$items = explode( ":", $items );
       			if ( trim( $items[1] ) == 'yes' ) {
       				$return[] = trim( $items[0] );
       			}
       		}
       	}
       	return ( empty( $return ) ) ? implode( ",", $data ) : implode( ",", $return );
       }
       ```
   
 * If you’re not using the ACF add-on, then you can use our API to import the values:
   [http://www.wpallimport.com/documentation/developers/action-reference/](http://www.wpallimport.com/documentation/developers/action-reference/)
 *  Thread Starter [Robin](https://wordpress.org/support/users/cinghaman/)
 * (@cinghaman)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/importing-for-checkbox-values/#post-8464049)
 * Perfect, thanks that’s what i was looking for
    Cheers

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Importing for checkbox values’ is closed to new replies.

 * ![](https://ps.w.org/wp-all-import/assets/icon-256x256.png?rev=2570179)
 * [WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets](https://wordpress.org/plugins/wp-all-import/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-all-import/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-all-import/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-all-import/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-all-import/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-all-import/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Robin](https://wordpress.org/support/users/cinghaman/)
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/importing-for-checkbox-values/#post-8464049)
 * Status: resolved