Workflow Example: Fetch Home Address

Workflow is an amazing piece of software, but it can’t always do everything you might want. At least not yet. One such thing that a Twitter user was having an issue with was identifying the home address of a contact. This was simply information iOS contacts hold, but was not directly available to check against within Workflow. There is however a way around this which is what this example is all about.

The workflow starts by saving a contact (you’ll need to amend the contact to one of your own) to file in iCloud. This is where the trick starts as the output format is a VCard and this contains some details that allow the address type to be identified. After saving, the workflow capture the file name and then reads the file back in from iCloud (unfortunately there doesn’t seem to be a way at this point in time to delete the file from within workflow).

Upon reading it in the file name is altered to give it a .TXT extension. This allows the content to be interpreted by Workflow as plain text.

A regular expression pattern match is then used to find a line where the address type has been set as “HOME”. That line is then split (by semi-colon separator) and the five items from the fifth item onwards are captured. These are the five potential address lines.

Theses are finally combined and displayed.

Tags: | workflow |