Build a Secret Santa App in 20 Minutes or less with PowerApps

It’s that time of year again, the holiday gift giving season has arrived. For some of you that means it's time for Secret Santa at the office. I decided this would be a great opportunity to showcase how quickly you can build an app with PowerApps. I'll walk you through how to create this Secret Santa app in PowerApps in 20 minutes or less.


I'm not going to go into all of the details of the app because I've put the completed PowerApp on my GitHub for you to download: https://github.com/aprildunnam/PowerApps. To use, just download the Zip file and upload it to your PowerApps Environment using the "Import App" option. 

The first step is to create a place to store the data.  While you could easily set this up in a SharePoint List, I decided to use Excel since that’s more readily accessible for most people.   I created a new Excel Spreadsheet with the following 4 column headings:

  •      Name
  •      Email
  •      Gift
  •      SS 

I put in one row of test data and highlighted the area and selected “Format as Table”. Make sure you also check the "my table has headers" checkbox.  **This is a very important step because PowerApps will only recognize Excel as a data source if the data is formatted as a table.  

Once the spreadsheet is configured, save it out to OneDrive. After downloading and importing my source code you will need to make sure you complete this step and change the data connection to point to your Excel file. Once you do that then everything else in the app should work.

Now that we have our back end configured, it’s time to create the front end using the blank phone app template in PowerApps. The Secret Santa app is comprised of 6 Screens:

  1. Landing Page
  2. Participants List
  3. New Participant
  4. Edit Participant
  5. Reveal
  6. Confirmation

On the Landing Page, I added a Label and set the text to “Secret Santa Helper”. I also modified the background color of the screen to a very Christmas-y red. Next, you need to add two button controls:

  • Manage List - Directs user to the Participants list
  • Draw - holds the logic to pick a random item from the participants list and directs the user to the results reveal page. 

Most of the pages are pretty straight forward. The most important part of the app is the logic that gets the random item from the list which is activated on click of the Draw and Re-Draw buttons:

Set(varRandom,Last(FirstN(Filter(Table4,IsBlank(SS)), 1 + RoundDown(Rand() * CountRows(Table4), 0))).Name)

In the above code, I am setting a global variable called varRandom to the name of the random participant so that we can pass that value to the next screen. It is using the Rand() function in PowerApps along with the Last and FirstN functions to do the random logic. The Filter function is filtering out items from the list which have already been picked. When a user clicks the "Confirm" button on the Reveal page, that is setting the Secret Santa field to "Filled" to denote that the participant has been selected. 

So, there you have it. With just a few steps you can have a fully functioning secret santa app in PowerApps!

要查看或添加评论,请登录

April Dunnam的更多文章

  • Navigating Difficult Waters

    Navigating Difficult Waters

    One person doesn’t define you. Don’t let the outlier ruin your perception.

    14 条评论
  • This Is Why: Women in Tech and That Unwanted Commentary

    This Is Why: Women in Tech and That Unwanted Commentary

    The tech industry is all about innovation and breaking down barriers. But for women in tech, especially those who share…

    46 条评论
  • 2023 Lessons Learned

    2023 Lessons Learned

    It’s the end of another year and time to reflect. 2023 was a year of foundation building and learning some lessons.

  • The Power Platform Global AI Hack Recap

    The Power Platform Global AI Hack Recap

    On September 14th we launched?The Power Platform Global AI #HackTogether?– a virtual hackathon all about using AI in…

    3 条评论
  • Same Form Control for New and Edit Mode in PowerApps

    Same Form Control for New and Edit Mode in PowerApps

    Today I want to talk about something extremely simple but I find is either not known or overlooked. In PowerApps, you…

  • PowerApps Bug: SharePoint Date Field Not Populated

    PowerApps Bug: SharePoint Date Field Not Populated

    I discovered a bug in PowerApps yesterday that I wanted to share so I could spare everyone else from the headache that…

  • E-mail Alert Reminders with Flow and SharePoint

    E-mail Alert Reminders with Flow and SharePoint

    One of my clients who's on O365 is currently keeping track of their employees certifications and their expiration dates…

  • Quick Guide to the SharePoint Migration Tool

    Quick Guide to the SharePoint Migration Tool

    Today, Microsoft released a new FREE SharePoint Migration Tool. With this free new tool you can: Copy files from a…

    1 条评论
  • ThriveFast Offers Help for Businesses After Tulsa Tornado

    ThriveFast Offers Help for Businesses After Tulsa Tornado

    August 12, 2017 THRIVEFAST– Our office building, located at the Remington Tower on 41st and Sheridan, was damaged on…

  • Calculated Column as HTML Fix for SharePoint Online

    Calculated Column as HTML Fix for SharePoint Online

    Don't you love it when you figure out a great work-around (or hack whatever you want to call it!) for SharePoint and…

    7 条评论

社区洞察

其他会员也浏览了