Creating Lists in Slack with Airtable!

I recently started to use Airtable after my previous database provider – Fieldbook declared that they would be ceasing operations from mid June. This has been somewhat of a bittersweet experience as I had to port all of our data over to a new provider and update all the integrations that we had. Zapier tells me that was about 60 zaps that we had to change so that was not ideal. 

Airtable was something that came recommended however so I decided to give it a go and see what could be done with Zapier. One of the reasons that we used Fieldbook was that you could search with multiple fields to find a record. Airtable doesn’t have this function as per say but they do let you search with a formula which does make it possible. Glad that we could solve that nice and quickly!

The next thing I wanted to do was see if I could find a way to list records. I like to use Slackfor creating ‘command lists’ which then can open up a menu of commands. You can see an example of such here in our FAQ list for approaching new properties for Roomfilla.

As you can see we have the list of fields which are from the FAQ and if you type FAQ Registration then it will pop up the information that you have requested. Building such functionality into Slack is relatively simple but not easy. For a demo of getting this done, I want to be able to list some websites in another channel so let’s get cracking.

First I will need to create a trigger, for this I’ll use the words ‘website list’. I will put this into the channel I want it to trigger, in this instance #sales and then go to Zapier to create the Zap. 

So this is pretty basic. The trigger is the message into the #sales channel and then a filter ensures it only runs if the text exactly matches ‘website list’. That is all good! Now we need to find the data in Airtable. The Airtable API docs are pretty easy to understand but there are a few things which you need to know when you start pulling stuff into Zapier. 

You can see here, the documents for the list records from Airtable themselves. To do this we want to send a webhook and here are a few things that helps to make it work in Zapier which I had to get help with from the support due to not knowing!

  • You should use the URL without any of the fields appended to it. In this image you see that max records and view are appended to it so you want to take them out. 
  • This is an important one. For some reason you need to put in a header field, User-Agent = null. The webhook won’t work without this and this was something I needed support to troubleshoot for me. 
  • Obviously you’ll need your API key which you can find by ticking the box in the top right of the image above. 

With this I have the URL and I am adding to show the grid view which is the spreadsheet style view. Below this I have the header fields where I have User-Agent = null and Authorization = Bearer API KEY. If you want to only return a few fields, you can use maxRecords in the query string params to do that. I want to return all so let’s test it. 

The test works but it returns everything like value1,value2,value3,value4. That doesn’t look so great but it is a simple fix with a few lines of javascript. The next stage of the Zap is a code by Zapier section. 

What this code does is it prepends the first record by a dash and a space and then adds a linebreak dash and space to each of the remaining records. Super simple and gets you the data in a way that you can then push to Slack. The final action is therefore a Slack action where you make a message in the same channel with the data. 

Automating Your Etsy Store!

How did I end up here?

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

Selling on Etsy is fairly difficult. If you manage to get some traction then you will find that more sales will likely follow. I started to sell a few things on Etsy to just try to understand the market and dip my toes into some ecommerce. It all started like all good things start… out shopping!

I was walking around Bangkok and figured to go into one of the shopping malls for the air conditioning and shelter from the sweltering weather. I didn’t really have any plans to buy anything and I think this frame of mind is very much the definition of mooching. I was mooching around and noticed there was a handicraft market going on in the middle of the shopping mall and decided to take a closer look. 

Pretty standard stuff but one thing in particular caught my eye – a stall selling handmade natural wood business card holders. I always see these guys at networking events with these metal card holders so figured I could probably make use of one. Purchase made, I went home and decided to research the guys who made them. They had a whole line of products and some of them were pretty cool. I figured, I could probably sell the stuff on Etsy as it was handmade and just work as a middle man connecting the Thai seller with the European, US and Australian buyers. Fast forward 3 months, and the first sale happened. 

Initial Traction

Please note if you are easily offended by me calling myself a ‘biatch’ in Slack, please click the x on this tab. Everybody should have the right to call themselves whatever they want.

That was cool! I can now see when an order comes in but I still need to manually go to Etsy, find out what it is and then message the guys to fulfill it. The deal I made was to not touch any goods, I hate the word but effectively dropship the items where I provide the item quantity and the address, they provide me the bill and everyone is happy. 

Turns out even this takes more time than I wanted to spend… how do you automate this so that I can literally click a button and have it taken care of?

Email Parsing comes to the rescue!

An email parser is something that looks at your email and looks for patterns within it, it then will extract certain pieces of text / data which you can then feed into other applications you may want to use. I figured that the important bits of text from an Etsy order confirmation were the following;

It will end up looking something like this. I took the transaction ID from the subject of the email but could have also grabbed it from the body.

Now I had all the fields I needed there was just one more problem. The makers of the products had somewhat standard names for them. I obviously had tried to make them sound more appealing playing on alliteration and other techniques. I couldn’t just send them the product name that I had and expect them to fulfill it. How would I go about fixing this? Time to get automatic. Let’s head to Zapier. 

Automating the Data

Before creating a Zap (process in Zapier). I like to try and envisage it in my head and write it down if possible. What we want to be able to do here is the following;

  1. Only process on emails matching the Etsy confirmation style – easily achieved with a filter. 
  2. Send the email to the parser – simple with the Parseur application.
  3. Take the parsed text and feed the product into a database to find the matching text – could use Google Sheets for this but I used Airtable.
  4. When the matching field is found, find the other field in the row which is the name the maker gave the product. 
  5. Compose an email to the maker with the Order ID in the title and ‘New Order Received – ID’ in the subject and giving the order details in the body with the quantity. 
  6. Compose an email to the buyer thanking them for the order and letting them know that we have many other products for sale and if they did want more they would save on shipping (the upsell).
  7. Add the customer email to a list – mailchimp or google sheet works here.
  8. Send a message in Slack to provide basic details on the price and items that have been ordered – this just ensures that I see it from the Slack command center. 
Easy life.

Issues to overcome

Parseur which is the email parsing product I use have a table parsing feature. This will identify a table and parse all data within it. This means if someone orders 1 item, it will parse the information for the 1 item, if 2 or 3, you will still get the items parsed. The problem with this is that it is hard to feed it into Zapier with the lookup database workflow to get the real names if you don’t know how many items are going to appear each time. This led us to not using this feature in the parser. So how did we solve it?

Parseur doesn’t put a limit on the amount of email addresses you can use for parsing. I simply created an inbox for 1 item and an inbox for 2 items and so on. It is rare that someone orders more than 4 different items from us, so setting up these 4 inboxes covered 100% of the orders. Now this does mean that you actually have to set up individual zaps in Zapier for each of these to run correctly and you will need to manually trigger the process by looking in the email for how many items before sending it to the right inbox.. this is a small price to pay for the freedom it allows though!