Title: Event import template
Last modified: August 5, 2020

---

# Event import template

 *  Resolved [nightsun73](https://wordpress.org/support/users/nightsun73/)
 * (@nightsun73)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/event-import-template/)
 * Hi,
 * Does anyone have an event import CSV template? Every combination I’ve tried so
   far reaults in asn ‘Not all required fields present.’ error. This is while using
   minimum fields.
 * thanks

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

 *  Plugin Author [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/event-import-template/#post-13213828)
 * Which fields are you using? The doc and some examples can be found at [https://www.e-dynamics.be/wordpress/category/documentation/19-csv-import/csv-import-events-and-locations/](https://www.e-dynamics.be/wordpress/category/documentation/19-csv-import/csv-import-events-and-locations/)
 *  Thread Starter [nightsun73](https://wordpress.org/support/users/nightsun73/)
 * (@nightsun73)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/event-import-template/#post-13214384)
 * this is what I am using at the moment:
 * “event_name”,”event_status”,”event_start_date”,”event_start_time”, “location_id”
   
   test,1,2020-09-26,10:00,1
 *  Plugin Author [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/event-import-template/#post-13214687)
 * Ok, tried the code (didn’t try a minimal csv import in a long time), and I added
   extra checks/code for better csv import:
    [https://plugins.trac.wordpress.org/changeset/2353411/](https://plugins.trac.wordpress.org/changeset/2353411/)
 * Your csv lines worked for me, but the end date and time was set to today and 
   the location id was being ignored, therefore the code change.
    Also for your 
   example: make sure to use regular double quotes, not slanted ones. And there’s
   a space before the location_id column in your header line.
 *  Thread Starter [nightsun73](https://wordpress.org/support/users/nightsun73/)
 * (@nightsun73)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/event-import-template/#post-13217438)
 * That worked a treat thank you. A couple of thoughts/ideas. Is it possible to 
   add a category by name rather than ID no? Also is there anyway to pull the co-
   ordinates from a postcode? If not I may have play myself and let you have the
   code if I get it working.
 * edit: found this code for pulling lat/long, which file would it best to intergrate
   this into to pull the location lat/long from the postcode?
 * function getLatLong($code){
    $mapsApiKey = ‘your-google-maps-api-key’; $query
   = “[http://maps.google.co.uk/maps/geo?q=&#8221](http://maps.google.co.uk/maps/geo?q=&#8221);.
   urlencode($code).”&output=json&key=”.$mapsApiKey; $data = file_get_contents($
   query); // if data returned if($data){ // convert into readable format $data 
   = json_decode($data); $long = $data->Placemark[0]->Point->coordinates[0]; $lat
   = $data->Placemark[0]->Point->coordinates[1]; return array(‘Latitude’=>$lat,’
   Longitude’=>$long); }else{ return false; } }
    -  This reply was modified 5 years, 9 months ago by [nightsun73](https://wordpress.org/support/users/nightsun73/).
    -  This reply was modified 5 years, 9 months ago by [nightsun73](https://wordpress.org/support/users/nightsun73/).
 *  Thread Starter [nightsun73](https://wordpress.org/support/users/nightsun73/)
 * (@nightsun73)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/event-import-template/#post-13217489)
 * one more, any way to import directly from an ICS file?
 *  Thread Starter [nightsun73](https://wordpress.org/support/users/nightsun73/)
 * (@nightsun73)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/event-import-template/#post-13217571)
 * sorry one more question. If a location already exists can we match location_name
   and location_zip in the csv so rather than creating a new location it uses the
   matched location?
 *  Plugin Author [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/event-import-template/#post-13218625)
 * I use openstreetmap for lat/long. I don’t know if they are resilient enough to
   be able to just decide a zip code … I’m away for the next 4 days so can’t check
   it now.
    ICS import is not supported. Location is checked if you use location
   name etc (like the examples mention).
 *  Thread Starter [nightsun73](https://wordpress.org/support/users/nightsun73/)
 * (@nightsun73)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/event-import-template/#post-13218695)
 * Cheers Franky, I’ll have a play and see what I can work out.
 * L
 *  Thread Starter [nightsun73](https://wordpress.org/support/users/nightsun73/)
 * (@nightsun73)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/event-import-template/#post-13218991)
 * OK,
 * Adding the following to eme_events.php at line 4428 gets the long/lat for the
   zip (you need to add your own google key). Althougb it adds the co-ordinates 
   it produces an error saying co-ords are not set, but when editing the lecation
   the co-ords are there and re-saving the record removes the error. Is there a 
   flag that needs setting that I’m missing?
 * if (!$location_ID && isset($line[‘location_zip’]))
    $mapsApiKey = ‘GOOGLE KEY’;
   $query = “[http://maps.google.co.uk/maps/geo?q=&#8221](http://maps.google.co.uk/maps/geo?q=&#8221);.
   urlencode($line[‘location_zip’]).”&output=json&key=”.$mapsApiKey; $data = file_get_contents(
   $query); // if data returned if($data){ $data = json_decode($data); $line[‘location_longitude’]
   = $data->Placemark[0]->Point->coordinates[0]; $line[‘location_latitude’] = $data-
   >Placemark[0]->Point->coordinates[1]; }

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

The topic ‘Event import template’ is closed to new replies.

 * ![](https://ps.w.org/events-made-easy/assets/icon-256x256.png?rev=1856035)
 * [Events Made Easy](https://wordpress.org/plugins/events-made-easy/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-made-easy/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-made-easy/)
 * [Active Topics](https://wordpress.org/support/plugin/events-made-easy/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-made-easy/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-made-easy/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [nightsun73](https://wordpress.org/support/users/nightsun73/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/event-import-template/#post-13218991)
 * Status: resolved