Maker Faire Journey – Contest Automation with Microsoft Flow & Forms
I recently had the opportunity to present with Microsoft at a local Maker Faire event in my home town. Maker Faire is an annual event that celebrates arts, crafts, science projects and the “Do It Yourself” mindset. The event featured everything from a DIY electric motorcycle and robotics competition to custom woodworking and gaming. This was the perfect audience to talk about PowerApps and Flow from the perspective of a personal app making tool.
The audience was a great mix of school aged kids and adults. The kids loved the Appy Bird and Magic 8 Ball demos. The adults seemed to enjoy Lawn Buddy and the Cognitive Services demonstrations. We also took the time to showcase Samit Saini and Brian Dang’s PowerApps journeys. Their stories serve as powerful examples of the impact you can make without having to know how to code thanks to PowerApps.
Brenden the Wonder Kid
I can’t write about my Maker Faire experience without talking about a young man by the name of Brenden. After our presentation, I opened the floor up for questions. The first one to raise their hand was 9 year old Brenden. “What can you do in PowerApps that you can’t do in .NET and vice versa”, Brenden asked. His follow up question was “What can you do in IFTT that you can’t do in Flow and vice versa”. I was shocked that question came out of a 9 year old! I had the chance to talk to Brenden after the presentation where I learned he has already set up his own web site in Azure and codes. Brenden was eager to go home that night and get his free trial of PowerApps and Flow. That experience alone made the event worth it.
Contest Automation
Now, on to how I used Microsoft Forms and Flow to automate the event. Microsoft had several prizes they wanted to give away after our talk. I remembered how my friend Ahmad Najjar had used Forms and Flow at one of his events to do a quiz and pick a winner. I took that concept and created a content entry form in Microsoft Forms:
In order to draw random winners, I utilized Microsoft Flow. I create two separate Flows, one that took the Forms entries and added them to a SharePoint list and another Flow button that I could press and it would get the entries in SharePoint and select a random entry. You may remember that I used this same get random from SharePoint logic in my Karaoke Buddy Flow.
For the Flow that adds the Forms entries to SharePoint, I utilized the “Record Form Responses in SharePoint” Flow template.
Thank God for templates, they make life so easy! All I had to do for this one is click on the template and point it to the site name and list on SharePoint.
For the random selection Flow, I created a blank Flow with the Flow Button as the trigger. The first thing I do is add an Initialize Variable action to store the selected winner name.
The next thing that I do is insert a Get Items from SharePoint action and point that to where my form entries are stored. Since we were going to be drawing for multiple prizes, I wanted to be able to track in my list who won and also ensure that it doesn’t accidentally draw the same name twice. To make that happen, I created a “WinnerOrLooser” column in my SharePoint list. In my “Get Items” action, I am putting in a Filter to only Get Items when the status is NOT Winner as you can see in the screenshot below:
To draw the random winner we are going to insert a compose action and use the RAND function:
body(‘GetEntries’)?[‘value’][rand(0,length(body(‘GetEntries’)?[‘value’]))
The rand function will return the entire list item so to get just the name, we have to tell Flow which column to get from the Output. That function looks like this: outputs(‘GetRandom’)?[‘Title’]. Where the ‘GetRandom’ is the name of your compose action with the rand function above and ‘Title” is the name of the column with the data you want to return.
Wrapping it Up
Finally, I want to update the item in SharePoint to mark that this person is a Winner and then Notify me of who the random winner is. I can insert an Update Item in SharePoint action and pass in the ID of the selected random winner using the same function I used to get the name: outputs(‘GetRandom’)?[‘ID’]. I will update the item to show that this person was a winner. After that, I am using the Notify on Mobile action to send me a mobile notification of who the winner is.
With the power of Microsoft Forms, Flow and SharePoint I was able to fully automate contest entries and select random winners. At your next event, ditch the paper and wow your audience with an automated contest system!
Recent Comments