Doodle Poll Party!

Alon Shomrat
doodle-tech
Published in
5 min readMay 29, 2019

Introducing the Doodle Bot, the next big thing for scheduling.

I’m sure you are all using Doodle polls to schedule meetings with large groups of people. Or maybe you’re using Doodle 1:1s for your quick one-on-one meetings. Whether you’re creating, participating or just viewing the results of polls, Doodling is very much an everyday thing for most of us.

What’s the other tool we use every day in our work lives to streamline communication and collaboration? Slack. Slack is the most popular business messaging platform today. Teams chat, integrate and manage daily tasks with it.

We thought — so much of our work already lives in Slack, wouldn’t it be great to create Doodle polls and schedule there too?

So, how did we start creating the Doodle bot?

First, we need to understand how to insert Doodle information and look into Slack platform, this will be done with the bot service. The bot service is the new service that will connect, interact and bring Doodle into Slack.

Our infrastructure at Doodle is ready to communicate with external tools and apps, we can use our API and events to get all the data and information we need. All the services needed for the new bot are using an event manager to talk to each other, so adding another service (the bot service), it can use the events from our existing services to get and add any information we need.

Second, we need to have the ability to add, modify and remove polls and information about polls in Slack, as fast as we can, as simply as we can. With the additional challenge of needing to have all the information updated in the web too. This means you can interact with a poll in any way, in Slack or on the web, and the poll will be the same everywhere. No small task!

Connecting the Doodle Bot to Doodle

You can create Doodle polls from the web or from the app, now we just need to throw Slack in the mix. How do we do that?

The first thing we need is to create this connection between the bot to Doodle’s DB and other services.

The bot will use Doodle’s API for creating and modifying the polls and will update the bot service according to those calls.

Communication between Doodle Bot and Doodle

Second, we need to update the polls created with the bot according to any changes done in the poll, via Slack or the web.

This is solved by the event manager and registration to the relevant topics. The poll’s instances will update when such an event occurs.

Communication between different services

Building the Doodle Bot with Slack’s Block kit

Now, we want to start creating polls in Slack, this is being done with Slack’s new framework — the Block kit (https://api.slack.com/block-kit).

It was extremely difficult to insert web design into Slack, but the block kit is perfect for that.

With the new block kit features, we can now have actions (buttons or dropdowns) in the same line as text, which is perfect for voting in a Doodle poll. We can pick a date easily with the new datepicker. You can get the number of voters and see who voted for what with the participant icon and we can have different sections with the new dividers.

With all those great tools, we can insert polls from the web to Slack with minimal changes.

Now, we can create the poll instances:

Poll instance with a regular view, created with Block kit only

Each one of the poll instances gets an update when it receives a new event (for example, if one will add a new time from the web, the new time will be added to all the poll instances in Slack).

How the Doodle Bot communicates with Slack

The connection between Doodle Bot and Slack is being done with Slack great API:

And the bot is triggered by slack slash command, action buttons and different events (channel events, user events…). For example, to start a new poll you just need to /doodle and hit enter (slash command trigger), you can edit the poll by clicking the `edit` button (action button trigger) and choose who to invite from the invitees dropdown, full with channels and users we have from different slack events.

So, now we can post, update and delete every instance we like.

Connection between Doodle Bot and Slack

The full picture

So, we talked about the full cycle that we need in order to have polls in Slack:

  • How to connect to Doodle and how all the services shared events with the event manager.
  • What do we need in order to communicate with Slack.
  • How we can build a Doodle poll with the new block kit.

We have now everything we need, let’s connect all the parts and see the full picture:

Doodle Bot full architecture

This is a solid architecture for the bot’s needs. The bot gets from Slack or from the event manager.

The bot business logic receives the app’s payload, getting it ready and route it to the right handler.

Now the data is sync with the Doodle DB so the web poll and Slack poll will be the same properties (e.g. same participants, same time options…).

After the data is getting handled, we are update every poll instance with the new data, built with the block kit.

Alright, let’s start scheduling!

--

--