How does a Salesforce architect announce to his family and friends the gender of the baby he and his wife are expecting? Using Salesforce and a Lightning Web Component, of course! A homemade confetti cannon also played a part :)
I’m Jason, one of the co-founders of Daydream. When my wife and I found out we were expecting, I wanted to design something special to help with the gender reveal. I adapted the Confetti Aura Component we told you about in a previous post - giving it a few new features:
I converted it from an Aura Component to a Lightning Web Component (using yesterday’s standards for such a forward-looking announcement didn’t seem quite right)
I added a color parameter to give the confetti a gender-appropriate look
I wrote an Apex controller to query for a single contact in the org which held a boy/girl value in a Gender custom field (Derek, the other co-founder of Daydream, set the gender value right before the big reveal)
I added some UI code to display a “Reveal” button that, when clicked, reveals the phrase “It’s a…” along with a dynamic tag to populate the gender, plus the confetti of course
Everything was wrapped in an Aura application that could be displayed full-screen with the computer connected to a TV so everyone could see
After a countdown, myself, my wife, family, and friends were delighted to be greeted by this:
As the screen lit up with the confetti and message, Derek triggered the real-life confetti cannon and the room was filled with actual blue confetti too.
If you’re interested, you can find the source code for the Reveal LWC on GitHub.