Build Your First Lightning Flow App – Part Five


We made it people. It’s taken five parts to get here, but we’re at the finale. Will Rachel finally get with Ross? Was the chicken that died on the bus really a chicken? Are we going to finish building our Lighting Flow app? And was the island purgatory all along?

Hopefully I’m not spoiling anything but:

  • Yes
  • No
  • Yes
  • No. The island was real, but the final season took place in a halfway world between the living and heaven. I liked the ending actually. I jumped on the Lost craze around season 4, so I never really saw the early episodes, still haven’t. I really enjoyed the story though and never really bought into an idea of the mystery of the island. That’s why I never cared that the writers didn’t explain any of that. By the time I started watching, the plot heavily geared around the different factions and bits of time travel. And boy do I love a good time travel story. Bill and Ted, Star Trek IV, Back to the Future and Timecop are some of my favourite movies. I was pretty much brought up on the Back to the Future trilogy and rented Back to the Future II on VHS so many times that my mum banned me from getting it again. There’s just something so appealing about the idea of revisiting history and getting the chance to do things over. Maybe that says more about me than it does about those kinds of stories. I can’t deny that I’ve romanticised about making changes in my past life. Even though I try to live with a “no regrets” attitude, I’ve done silly mistakes that make me wince.

Ha! I’m going wildly off track, we’re not here to learn about time travel movies.

Lost nearly turned out very different as Matthew Fox wasn’t originally supposed to play Jack. Michael Keaton was approached to be in the pilot episode with the idea that he would killed off before the end of the 2 hour runtime. It smacks of stunt casting. A dirty tactic just to get some audience or studio interest and I’ve never been a fan of that. I’d much rather the story carry the weight of a TV show because if it’s any good, a big name shouldn’t change that.

Wait. I don’t think we’re here to learn about Lost either. Load up your developer org and let’s do this!

Activating the Flow

One little detail missed from the last part was the activation of our Flow. Even thought we were able to successfully test the process, we can’t use it in our live environment until it’s activated. That just takes a few simple steps though.

Head back to the Flow menu and click on the name of the process. Don’t click on Open or Edit as this will take us to the wrong area. It can be mildly annoying, but once you know to avoid it, it’s easy.

You should now see a list of different versions of our Flow with a link labelled Activate next to them. Locate the latest version and hit Activate.

Building the Lightning App

From the Setup page, type Lightning App Builder in the quick find text box. Click on the only result and you will find yourself in the App Builder. From here, hit the New button. You’ll now be given a number of options that define where our app will be displayed.

In our case we’re going to create a new Home Page. Select Home Page and then Next. We’ll now need to name the app (I’ve gone with “My New Home”) and click Next. Finally, select a layout and hit Finish.

You’ll now be presented with a canvas to build your app. Throw some items on there to fit your home screen needs. Hopefully it will look something like this.

The next item we need to place on the canvas is the Flow component. Drag the component to an area you’re happy with and in the right hand side menu, you should have YouTube Flow automatically selected.

Hit the Save button and then Activate.

We’re now given a few options as to where this home page will be displayed. We can change everyone’s home page as a default or tailor it to specific apps and profiles. In this case, we’ll change the home page for everyone. Select Assign as Org Default and then Save.

If you now navigate to the Sales app of your developer org, you should see the new home page in all its glory.

The Flow is now in an app and ready to record feedback from your user base. As you gain data, you can review it under the Video Ratings tab and even build up a report to gain useful insights.

Congratulations! We’ve successfully combined several elements of the Salesforce platform together to make a cohesive experience. We’ve built a Lightning Flow app.

We can put up your feet and take a well deserved rest… Or, we can take this to next level. There are a few places where we can improve the user experience.

For example, we could add a screen to our Flow that thanks gives a little thank you message. We could also update the Flow to change an attribute on the user’s record that identifies that they have watched the video. Armed with that information, we can use a handy tool within the App Builder to hide the Flow. Conditional Visibility allows us to hide components under certain circumstances and in this context, we can stop people from giving feedback multiple times. This is easily my favourite feature within the App Builder.

Now we’re at the end of this tutorial, I highly recommend you take all of these awesome features we’ve covered and put your own spin on them. Come up with some ideas, build and share!

Thank you for coming on this journey with me, I hope you found it useful.