The First Not-Really-Annual-We-Just-Do-This-When-We-Feel-Like-It Community Flow Hackathon!

2012.05.04-HackathonOn the 25th of June in the year of our lord 2014, it was hereby decreed that there would be a great ‘Thon of Hacking, dedicated to the communication of ideas and knowledge of The Great Flow. Over the following 7 days, many heroes from across the land ventured forth to slay the Dragon of Communal Ignorance, valiantly submitting their contributions and felling the great beast. When the dust cleared on the 2nd of July, there were only victors.

Hang on, I think my nerd is showing. Can you tell I run Dungeons & Dragons games in my spare time?

If you have any interest in Flow, I highly advise heading to the Success Community page for the #Sp14FlowHackathon topic, where you can see the collective hackathon in its entirety. It was started in the group “Official: Salesforce Workflow Automation“, and there truly were some amazing ideas. I’ll be dedicating an entire blog post to my submission next week, but at the moment I want to highlight some of the other submissions here.

(The following “awards” are mine and mine alone, and I do not represent Salesforce or any other company or individual.)

Best Use of New Features Award – Reassign Records when the Owner becomes Inactive

Jen Nelson brings the awesome with a Flow that uses Flow Triggers, Fast Lookups and Loops seamlessly. What’s more, it’s incredibly useful to ANY admin and operates quietly, predictably, and seamlessly. It’s the sort of automation that throws off new admins in the org; it’s so clean that it fools them into thinking it’s part of core Salesforce functionality, not realizing something else enabled it. Hey Jen, be sure you train any new admin you work with that this is flow! Otherwise he’s going to get that question wrong on his 201 Certification test!

Most Work Saved Award – Assign and Maintain Due Dates for all Tasks in a Campaign

Jen Dunn not only wins the award for Most Work Saved, but also for Most Patient Users! Whoever had the job of manually assigning and updating up to 35 tasks had a crap job, and Jen made it a whole lot easier! I just hope you didn’t put someone out of a job! This is a prime example of the power of Flow: taking a massive, repetitive task and reducing it to a few clicks. Bravo.

Wildest Idea Award – Clone Chatter Group with Members

Rakesh “The Flow Machine” Gupta makes us all ask ourselves the deep philosophical question: “Will I ever have to clone a Chatter Group? And if so, what am I going to do about all those Members?” That’s heavy, man. So hardcore. If nothing else, I love Flows like this because they make admins stop and say “Wait, Flow can do THAT? If it can do that, I wonder what else it’s capable of.” Nothing better illustrates the breadth of awesome that Flow can accomplish.

These are just some of the Flows that were shown. Go and take a look at the rest!

 

How I Learned to Stop Worrying and Test My Flow

darthvadertestingDo you write Flows? If so, congratulations, you’re a developer. No no, you are. You’re developing software, just with a declarative interface, so yes, you’re a developer. And what does every developer have to do, even though they hate it?

Test. Test. Test.

Once you’re a developer, you’re not exempt any more! Welcome to the development world. Yes, we hate testing. We like to think our Flow is just going to work the first time, but in all of the 30+ flows I have written in my time, I can only say that I am just lucky enough to have gotten away with it once. Seriously, that’s like a 3% chance.

Even then, I played it safe, and verified that it was going to work right by testing it first. You will save yourself SO much time and frustration by testing before deploying.

Flow is a unique beast, though, and there’s not a lot of documentation out there on how to test your stuff. By and large, we’re left wondering just what we should do to actually test. There’s some obvious things, but then the only truly obvious route is to actually deploy in order to test, and that’s not always a good option.

So without any further ado, here are some of the methods and guidelines I have come up with for testing my Flows.

1. Sandbox Sandbox Sandbox

sandboxes

I know sandboxes seem like a waste. I know the concept is alien to some of us. But really, do it. DO IT. This is especially important for Flow Triggers, which, I can attest to personally, can cause stupendous failures.

When a Visual Flow crashes, it only affects the person trying to run the flow, and usually just throws an error. When a Flow Trigger crashes, that crash can affect ANYONE who is trying to do their work. Even if you have “Administrators run the latest flow version” turned on, you can still have problems if you haven’t activated any versions. So trust me when I say, Sandboxes are more important than ever before for Flow.

2. Always Fault

There’s nothing that your users hate more than a cryptic error. Seeing

An unhandled fault has occurred in this flow. An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information.

is the surest way to frustrate and confuse, not to mention driving your users AWAY from using your blood-sweat-and-tears Flow. Nobody wants to use a tool they don’t understand, so quite simply, they won’t.

So how do we avoid this? We add Faults.

Screen Shot 2014-05-06 at 13.54.13

Every Create, Update, Lookup, or Delete.

Any Record or Fast Element can have a Fault element attached to it, and your best practice is to ensure that every Record or Fast Element has a Fault element attached to it. A Fault element can be made by creating any element and drawing an arrow to it from your Record or Fast Element AFTER they already have an arrow pointing to another element. If the Flow errors on that source element, it will then perform whatever is in your Fault, rather than showing that “unhandled fault”. That’s what unhandled means; it means that you haven’t defined what should happen when a fault happens.

A fault can contain a message to the user, it can create records, it can even send an email if you use the Email Plugin. Anything Flow can do, you can make happen from a Fault, so this is invaluable not only to your users, but also to your debugging and testing. Having a screen that tells you what your variables’ values are AT the point of failure is essential.

Another quick tip: if you want your fault to do things AND present a screen (I almost always have mine send an email and then show a customized error in a screen), do the email or other things first, THEN do your screen. If a user gets an error message screen, they are a lot more likely to exit the screen instead of clicking the Next or Finish button, and if they don’t click that button, it WON’T fire your email or other actions.

3. Gotta Test ‘Em All

portalmon-shirt

This is another drudgery chore, but as admins I cannot stress enough that you have to personally try out your functionality. Don’t just try your flow while logged in as you; try it while logged in as the actual users who will use it. Try each choice option you present in your screens, or at least a sample of them, if there are too many to test. Make sure you run your Flow through every possible decision path, to be sure each decision path actually works.

Also, try your flow while logged in as the actual users who will use it. What, I already said that? Well, good, it needs to be said again. It’s so easy to forget to do, because you have to do it in a sandbox in order to do it safely, but it’s one of the most important things you can possibly do in your testing.

So How Do I Test Exactly?

The Temporary Assign Element Method

Screen Shot 2014-05-06 at 13.58.00

The Run button is a great option in the Flow Designer, but unfortunately it’s fairly useless without some setup. Almost every flow needs some data passed to it, and that Run button cannot pass any of that data. So how do we make it useful again?

Create an Assign element BEFORE the start of your Flow, and in it, assign some sample data to the variables that would usually have been set. Draw its arrow going to the start of your Flow, and then make the Assign element the actual starting element.

You can now use the Run button with impunity! This makes testing a lot faster when you don’t have to click around to get to your Flow, and it has the additional bonus of being able to test your Flow (at least, the testing that you do while logged in as you) without making it live for everyone. It’s a great way to do quick proof-of-concept testing as well.

Please keep in mind this doesn’t work on any flow with sObject variables or collections at this time.

The Screen Debug Method

Screen Shot 2014-05-06 at 14.06.44

This ties in directly with bullet point 2 above. If, in your testing, you hit an error or bug or other unexpected result, being able to insert a temporary Screen that just repeats what the variables or Screen Choice values are at any given point can be the key to unlocking the mystery behind your dysfunctional flow. There is no reason this cannot be done at any time; you can insert this into the middle of your flow’s track without having to use a FAULT path, so you’re seeing things as they happen, even before the error comes down.

Of course, because this method uses Screens, it is incompatible with Flow Trigger flows. Bummer.

[Edit: Removed the Flow Debug object method. Turns out this has some pretty glaring issues with most faulting in Salesforce. Thus reiterates my overall point about being extremely thorough in your testing of, well, anything.]

Video

Visual Workflow Live! Complete Task and Notify

After wrestling with YouTube, I FINALLY have this video up and ready. Needless to say, I have learned a few important things from my first live-streaming experience:

  1. Do not play background music. Chances are it’s copyrighted, and YouTube will either restrict it or block it. Sorry, Salesforcers in Deutschland, this video won’t work for you. 😦 It also means the last few minutes of audio got muted forceably by YouTube,  so I had to annotate it manually.
  2. Do not check your own stream on the same computer you’re recording on. It’ll pick up and audio and you’ll have two audio streams being recorded simultaneously. It’s kind of like a time machine, thanks to the 20 second delay, but not as cool.
  3. YouTube’s built-in video editor is OK. It works for what I need. Might need something more advanced someday, but for now, it’s good.
  4. Need more people in the chat! Had at least one person in the chat contributing, and it was a big help. Thanks lifewithryan!

So without further ado, here’s the video from last week, and look forward to more video coming soon!

Live broadcasting tonight!

Justin.tv_

 

Let’s try a little experiment, shall we?

Tonight, starting at 9pm Central Time, I’m going to be working on a redesign of a Visual Workflow for tasks to deploy to production. The twist? I’m going to be doing my work LIVE on the air for everyone to see!

I’ll be using a site called justin.tv, which is specifically designed for this sort of thing. Many different kinds of artists and designers use justin.tv to broadcast their creation process, and so I shall be doing the same.

I’ll be talking through my visual workflow work, as well as taking questions, so consider this a two-birds-one-stone kind of event; you can watch how visual workflow is made, and/or take the opportunity to ask an experienced Salesforce admin and visual workflow designer any questions you might have. The questions don’t even have to be visual workflow related! I’ll help out any way I can, if I can.

If you want to ask questions, you’ll have to create an account on justin.tv, but the good news is that accounts are free. If you get routed to a page asking if you want to pay for a Pro account for $9.99 a month, this is NOT NECESSARY, so don’t feel obligated.

When 9pm rolls around, click this link (http://justin.tv/salesforceyoda) OR the justin.tv logo at the top of this article, and it will take you there.

And now, a little FAQ:

  • What is justin.tv?

Well, have you heard of twitch.tv? If you have, justin.tv is the predecessor to twitch.tv, and is run by the same people. It’s basically the same thing as Twitch, but for things that are not games.

If you haven’t heard of Twitch, justin.tv is a live-streaming site. It lets people from around the world broadcast whatever they want (within moral guidelines of course) for free, for other people to watch. People can broadcast for free, and people can watch for free. And I mean free as in beer!

  • But the site is asking me for money…

Don’t worry about it. Click back and find the Sign In button at the top. I make no money from this, and in no other way get any reimbursement from Salesforce or justin.tv. Yes, justin.tv and Twitch have subscriber options where the broadcasters can make money, but I am not using that functionality.

  • If you’re not getting anything for doing this, why are you doing it?

Multiple reasons in this answer. One, I really like helping people, and having an “open office hours” of sorts appeals to me. I may not be the best admin, but I’m no slouch, if I may say so myself. This is my way of contributing.

Two, people love to watch people. It’s in our natures. And we love watching people do things that we do. I know that I would love to watch someone work in Salesforce; I looked to see if anyone was doing this sort of thing, because I wanted to see it! Since I couldn’t find anyone, I figured, why the hell not.

Three, visual workflow is a bit of a beast. It’s difficult to explain how you put a Flow together with text alone. By livestreaming it, people can watch and understand the process, and ask questions if they see something they don’t quite get.

  • How do I do (X) in Visual Workflow?

Woah there, Silver. Save your questions for the livestream.

  • How do I talk to you or ask questions once you’re streaming?

You’ll have to sign up for a justin.tv account, but once you do, you’ll be able to post in the Chat on the right side of the screen.

  • Why so late at night?

Believe me, trying to livestream with a toddler demanding your attention is not really possible. Trust me when I say it’s best to wait until after her bedtime.

  • If you’re doing your work live, doesn’t that put your company’s data at risk?

That’s why I’ll be working in a non-full sandbox. Cuz I’m smaahhht, see? Smaaahhht.

  • Ok, Mr. Smarty-Pants, what if we see you doing something dumb in the livestream?

Oh, I’m definitely human. I make mistakes. If you see me doing something in Salesforce that you think would be better done in another way, or is something that is just plain stupid, call it out! Let me know! I’m a big boy, I can take it. Even the best have their off moments, and I’m not even the best, so I expect my off-moment quotient to be higher.