Answers.Body: <p>The address is stored in an Address entity.  You then create a LocBlock entity that links to that address ID, and the event references the loc_block_id.</p>
  
  <p>This is a bit tricky to do with the CSV API Import GUI because it only supports importing one entity at a time, as opposed to using <a href="https://docs.civicrm.org/dev/en/latest/api/chaining/" rel="nofollow noreferrer">API Chaining</a>.  There are several approaches that support API chaining but unfortunately they're all significantly more complicated than API CSV Import GUI.</p>
  
  <p>If you'd like a manual method:</p>
  
  <ul>
  <li>Note the max ID in <code>civicrm_address</code> (<code>SELECT MAX(id) from civicrm_address</code>).</li>
  <li>Import your event addresses.  Note the new max ID.</li>
  <li>Note the max ID in <code>civicrm_loc_block</code> (<code>SELECT MAX(id) from civicrm_loc_block</code>).</li>
  <li>Create a spreadsheet with a list of new address IDs only.  Import that as a LocBlock entity, mapping to <code>address_id</code>.</li>
  <li>Note the max ID in <code>civicrm_loc_block</code>.</li>
  <li>Paste the <code>loc_block_id</code> into your original event spreadsheet as a new column.  If you successfully imported all addresses in the same order as they appear on the event CSV, your <code>loc_block_id</code>s should line up.</li>
  <li>Import the events.</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-04T03:32:22.370Z
Answers.Text: It seems pretty stupid to create something that allows for you to import a large number of events, yet you can't add the address to them. So now you have to go through and edit all those events manually to add the address. Guess I'll just go through all 1,700 events and manually add the city & state.
Answers.UserDisplayName: Jenni Simonis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-04T04:37:44.393Z
Answers.Text: @jennisimonis - The CSV API Import GUI is just a front-end on the API, a shortcut to avoid writing extensions.  However, if you'd like to write the extension that does this in one step, it's an excellent starter project!  Come join us at chat.civicrm.org in ~dev-newcomers, folks will be happy to help.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-05T20:27:12.747Z
Answers.Text: Unfortunately that's well outside my expertise. I know just enough PHP and SQL to be dangerous. ;)
Answers.UserDisplayName: Jenni Simonis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-03T14:00:48.903Z
Answers.LastActivityDate: 2018-07-03T14:00:48.903Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>I found the API CSV IMPORT GUI that allows me to import events. The one thing I can't figure out how to map is the location details - city and state. How do I map those two items?</p>
  
Tags: <civievent><data-import>
Title: Importing events - location
ThreadText: # Importing events - location
  
  (Asked by: username_0 on 2018-07-02)
  
  I found the API CSV IMPORT GUI that allows me to import events. The one thing I can't figure out how to map is the location details - city and state. How do I map those two items?
  
  **Tags:** civievent, data-import
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-07-03. Score: 1
  
  The address is stored in an Address entity. You then create a LocBlock entity that links to that address ID, and the event references the loc\_block\_id.
  
  This is a bit tricky to do with the CSV API Import GUI because it only supports importing one entity at a time, as opposed to using [API Chaining](https://docs.civicrm.org/dev/en/latest/api/chaining/). There are several approaches that support API chaining but unfortunately they're all significantly more complicated than API CSV Import GUI.
  
  If you'd like a manual method:
  
  * Note the max ID in `civicrm_address` (`SELECT MAX(id) from civicrm_address`).
  * Import your event addresses. Note the new max ID.
  * Note the max ID in `civicrm_loc_block` (`SELECT MAX(id) from civicrm_loc_block`).
  * Create a spreadsheet with a list of new address IDs only. Import that as a LocBlock entity, mapping to `address_id`.
  * Note the max ID in `civicrm_loc_block`.
  * Paste the `loc_block_id` into your original event spreadsheet as a new column. If you successfully imported all addresses in the same order as they appear on the event CSV, your `loc_block_id`s should line up.
  * Import the events.
  
  > **Comments:**
  > **username_0**: It seems pretty stupid to create something that allows for you to import a large number of events, yet you can't add the address to them. So now you have to go through and edit all those events manually to add the address. Guess I'll just go through all 1,700 events and manually add the city & state.  
  > **username_1**: @username_0 - The CSV API Import GUI is just a front-end on the API, a shortcut to avoid writing extensions.  However, if you'd like to write the extension that does this in one step, it's an excellent starter project!  Come join us at chat.civicrm.org in ~dev-newcomers, folks will be happy to help.  
  > **username_0**: Unfortunately that's well outside my expertise. I know just enough PHP and SQL to be dangerous. ;)  
  
  ---
  
  