How to Create a Basic Auction Bot in Workplace

In this guide, we will talk you through how to create a basic auction bot in Workplace. The bot will allow employees to place bids on a variety of items and record the highest bids in a Google Spreadsheet.

In this guide, we will talk you through how to create a basic auction bot in Workplace. The bot will allow employees to place bids on a variety of items and record the highest bids in a Google Spreadsheet.

Step 1

First we need to create a bot on The Bot Platform. This bot needs to contain a carousel of items to be bid on, a message that displays the current highest bid and then asks if the user wants to place a bid. The bot then records the bid value and checks that it is higher than the current bid. If it is, the highest bid value is updated in the spreadsheet and the highest bidders name is also recorded.

256256 496496

In our first message, we set up the carousel of items people can bid on. You want to include a button which stores a user attribute and sends the next message on each item. In the attribute value field, make sure you enter a short description of the item they will be bidding on.

In the next message, we want to return the current highest bid for that item. Create a new message that contains a webhook, a generic message that states something like ‘The highest current bid is:’ and then a delay. The final message should ask the user if they want to place a bid, with a button that links off to the bid amount message.

225225

Head over to Integromat and set up a new scenario. You want to add the webhook module and create a new webhook. Copy the webhook URL and paste that in the webhook field in your bot.

We now need to create a Google Worksheet that can record all the bids made in the bot. Our spreadsheet looks like this:

353353

Now we want to click the run once button on our scenario and run through our bot to this point.

Step 2

Now we have run through and pulled the item variable through from our webhook, we need to look up that item in our spreadsheet. Add in a Google Sheet module to your integromat flow. You want to use Search rows. You need to search the item column for the item they have chosen from your carousel. This should be set up as follows:

445445

We now want to return the highest bid value looked up in that spreadsheet. So we need to add a webhook response via Integromat.

You will want to use the basic message response which would look like the following:

{
  "recipient": {
    "id": "USER_ID"
  },
  "message": {
    "text": "Hello world"
  }
}
398398

Replace the USER-ID with the FBID pulled through from your webhook and in the text, use the current highest bid field found in the previous search step.

Now if we run this scenario and test our bot, you should see that the highest bid value is now being displayed.

465465

Step 3
Now we need to set up the actual bid process.

In your bid amount message, add a basic Q and A message that asks how much the person would like to bid and save that with an attribute of Bid value. Once they have entered a value, it should then go to a bid confirmation message. This message needs to contain another webhook field.

Create a new scenario in Integromat and set up a new webhook. Copy and paste this webhook into your bot.

Click the run once button on your new scenario and run through the bot. You will now see your bid value has been pulled through.

259259

Now we need to search our Google spreadsheet for the item so we can compare the bid value to the current highest bid.

We then want to add in a Router to our Integromat scenario so we can break the future journey down into two parts; if they put in a higher bid and if they don’t.

First we will put in an error message incase the bid they enter is not higher than the current highest bid. Add in a webhook response that responds with a message that their bid is not higher than the current bid.
Your flow should now look as follows;

609609

We need to filter this branch to ensure it only triggers when the bid is not higher than the current bid, so we add a filter as follows:

239239

We now need to add in the journey if the bid is higher than the current highest bid. First we set up a filter to ensure the new branch only triggers when the bid is higher.

279279

We then want to add an Update a Row in Google sheets module.

Your Row number should be the row number pulled from your search step. You then want to update the highest bid with the value the user entered and update the highest bidder name with the firstname and lastname fields pulled from the webhook.

It should look like this.

265265

We now want to add on a basic webhook response that confirms that their bid has been successful. Your bot is now complete and ready for testing. You should see the new highest bid is pulled through when you go back to the info screen.