King of the Org - Ryan

King of the Org: Ryan

Congratulations to Ryan for being crowned king of the Org! How does one become queen or king of the Org at CloudKettle you ask? We introduce a challenge related to Salesforce or another part of our business that everyone internally has the opportunity to participate in. To even the playing field, we’ll usually host information sessions if the challenge requires a certain skill that not everyone may have. The winner of each challenge wins several prizes, but perhaps most importantly they are given the office crown to be worn or displayed at their desk.

We sat down with Ryan to learn how he solved the latest Salesforce IoT challenge.

Explain the challenge in 19 words or less

Ryan:Reconfigure a hockey light to go off every time an Opportunity is closed as won in Salesforce.

What was your approach?

Ryan:The hockey light comes preinstalled with an electric Imp chip so my first step was to figure out if I could reverse engineer the chip and write my own code on the existing chip. However, all these chips are locked to the hockey light manufacturer. After realizing this approach wasn’t going to work, my next attempt was to build everything from scratch with a Raspberry Pi and use the speaker, LEDs, and shell of the light.

What was the most difficult part of the challenge?

Ryan:The most difficult part was getting the hardware setup and working. The LEDs have these very finicky solder joints on them which I ripped off several times. Trying to organize all the wires inside the shell was also quite difficult because I didn’t exactly put the hardware together in a way to fit nicely into the hockey light metal shell.

How did you solve the challenge?

Ryan:The overall architecture involves three components:

  • The code in Salesforce, which fires a rest request every time an Opportunity closed as won and when a Case closes (the Case part was for bonus points).
  • A Node JS App hosted on Heroku that handles these POST requests from the Salesforce side. This Node JS app acts as the intermediate between Salesforce and the Light. This way the light doesn’t have to communicate with Salesforce directly – for security reasons.
  • The Raspberry Pi controls the light and speaker. The Pi checks the Node JS app with an HTTP GET request every 10 seconds to see if Salesforce has pushed new information to the Node JS app. When it does it clears out the values and based on the information provided takes appropriate action.

The information passed between Salesforce to the Node JS app is two boolean values and one string field. The booleans tell whether a Case closed or an Opportunity closed and the string value tells which currency the Opportunity which was last closed was in. When this is consumed on the Pi it plays a different song with a different light pattern depending on if it was an American or Canadian sale. If a Case closes the light has a different light pattern as well.

What was the monetary prize and what did you do with it?

Ryan: I won $250 dollars that I could use to treat our team to anything (legal and in good taste). I decided to order lunch for an all staff lunchtime meeting from a couple of the team’s favorites spots.

How does it feel to be King of the Org

Ryan:On a scale from one to ten, I’d say a solid 11.3.

Wrap Up

Who will be the next king or queen of the Org? Stay tuned! If you’re interested in seeing the rules and instructions for this challenge click here.

You may be interested in

Using Field Service for Post Hurricane Recovery

Using Salesforce Field Service for Post-Hurricane Recovery

CloudPower is a large electricity company that serves parts of Canada and the United States. Last year, damage from hurricanes destroyed power lines and other infrastructure, resulting in tens of thousands of CloudPower’s customers living without power for an extended period. Due to internal inefficiencies with scheduling, CloudPower could not restore power to thousands of […]

Read More

Restriction Rules in Salesforce

Restricting Sensitive Data in Salesforce with Restriction Rules

Introduction As part of the Summer ‘21 Release, Salesforce announced the new Restriction Rules (Beta) feature. This new feature provides an additional layer of security on top of the existing OWDs and Sharing Rules. It allows Admins to restrict access to sensitive records for certain users by setting up the filter conditions in the Restriction […]

Read More

Sign up for the latest tips & news from CloudKettle

Thank you for subscribing.