Jump to content

Lookup Workflow?

Recommended Posts

Hi Guys,


I was hoping to find an existing workflow where I could type in a key phrase and it would return an associated value. For example, I could type in a customer_name and it would return the customer_id. Extra points if it could search for partial matches. Currently the values are in a SQL DB, but I could dump them into a google sheet or something. 


Any places you guys recommend to start my search?




Link to comment

Here is a demo workflow I wrote for someone that does exactly this, but based on an Excel spreadsheet.


The code is extensively commented to explain what's going on. It's be easy enough to swap out the Excel bit for a database, but you didn't say what kind of database you're using. A Google sheet would be a terrible idea, as they're online only. It would make the workflow a lot slower and a lot more complicated to implement (you'd need to work with the Google APIs).


It uses Alfred-Workflow's search algorithm, so you get partial matching, substring matching, initial letter matching etc. out of the box.

Edited by deanishe
Link to comment

Wooho! Thanks deanishe! Got it installed and working. However, I have to ask a total knob question. I've updated the Data.xls file that it's referencing search.py with my data. Clearly I need to do something to get it to reload my data. Do I need to build the workflow? Is there a page somewhere that explains this? 


Sorry for being such a dummy :-(



Link to comment

Regarding MySQL: If Google uses a standard MySQL installation, the workflow can be modified relatively easily to pull data directly from the database. You could query the database live (i.e. on every query) or periodically cache the dataset you're interested in. Alfred-Workflow makes the latter very simple to do. I recommend you read the Alfred-Workflow docs linked in my signature if you want to know more.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...