Using VBO to update address/email Location type

I spotted this on StackExchange and Link was okay with me adding this to the repository here. Link's issue was that he had a bunch of Organization contacts with "Work" addresses that he needed to change to "Main" addresses.

He installed CiviCRM Entity and used VBO and found it gave him a very powerful way to search, filter, and mass-modify the addresses in our database. Here is his recipe:

  1. Create a new view that shows CiviCRM Address entities and provides a page

  2. Add a Bulk Operations: CiviCRM Address field and configure it under "Selected bulk operations" to "Modify entity values" and select "Address Location Type" under its "Operations settings"

  3. Add a filter for CiviCRM Address: Address Location Type and set the location type that you want to change. Or expose the filter so you can filter at will. Refer to civicrm/admin/locationType?reset=1, hover the edit links to get the location ID from the URL

  4. Visit your view's page and check the "Select all" box. "Modify entity values" and enter the ID of the location you want set on all addresses you have selected in the view