FlowFest is an online competition where participants have to create flows within 50 minutes. Salesforce Ben and Ohanaly hosted the fourth edition, FlowFest V4, on February 22nd, 2023, just like they did with the previous events. The competition had a new format where the top four finalists were chosen after finishing the first three challenges. Then they shared their screens for the final challenge. Let's take a look at the challenges of FlowFest V4. Here is the answer of FlowFest V4 - Challenge 4.
FlowFest V4 - Challenge 4 - Question
The leadership at Universal Containers has asked to provide a weekly recap screen flow that details out overall stats about current Opportunities that could be used on the Home Page.
This information will include the following:
- Total Number of Opportunities
- How many Open Opportunities
- How many Closed Won Opportunities
- Average Deal Size for Closed Won Opportunities
- Total Number of Opportunities whose Amount is greater than Average Amount of Closed Won Opportunities
Then, leadership wants to see a bit of inspiration for the team: Include a table of the top 5 Opportunities of all time (open or closed), based on Opportunity Amount. The list should have the Opportunity with the highest amount at the top and descend from there. Make sure that Name, Amount, Stage and Close Date are visible.
Finally, leadership wants to see the largest upsell possibilities where we do not have Opportunities open with them. Include one more table that displays the five (5) Accounts with the highest Annual Revenue that are of either Type “Customer - Direct” or “Customer - Channel”. These should only list Accounts with no Open Opportunities. For these, they need to see the columns Name, Annual Revenue and Type.
FlowFest V4 - Challenge 4 - Answer
1- Add a get records element to get all the opportunity records.
2- Create a number variable and then add an assignment element to store the total number of opportunities.
3- Add a collection filter element to filter the open opportunity records.
4- Add a loop element to iterate over open opportunities. Then, create a text collection variable and use an assignment element to add the account ids to the collection.
5- Add a collection filter element to filter the opportunity records that are won.
6- Add a loop element to iterate over won opportunities. Create a number variable and add an assignment element in order to calculate the total amount of these opportunities.
7- Create a number variable and then add an assignment element to store the number of won opportunities.
8- Create a formula resource to calculate the average amount of won opportunities. Then, add another collection filter element to filter the opportunities that are greater than the average amount.
9- Add a collection sort element in order to sort the opportunities by their amounts. Make sure that you keep the top 5 opportunities.
10- Create variables and then add an assignment element to store the results.
11- Add a get records element in order to get the account records that meet the criteria. These accounts should not have any open opportunities. Therefore, you should use the not in operator.
12- Add a collection sort element to sort the accounts according to their AnnualRevenue values in descending order. Then, keep top 5 records.
13- Add a screen element with a display text component to display the calculations. Then, add a data table in order to display the top 5 opportunities. Display Name, Amount, and Close Date fields as columns and make sure that the table is view only. Add another data table to display the top 5 accounts. Display Account Name, Annual Revenue, and Account Type fields as columns. Again, make sure that the table is view only.
At the end, your flow should look like this.
FlowFest V4 Challenges
Here are the answers of all the FlowFest V4 challenges.