I love it when in the course of an average day you have that moment when the light bulb gets turned to on, the heavens part and there in front of you is something new and exciting.
This is how my light bulb moments look, don’t judge me
For example, I was building out my clone user flow for #salesforce1selfies and started thinking about how I had my search page set up. It was fairly standard with a text box where I would enter in a user ID but like Freddy Mercury, I want it all.
I wanted to be able to search on name,email and user ID and I wanted to do it from within one text box.
“One field to rule them all, and in the flow logic bind them”
Really, it sounded pretty simple, but then again, you can sum up the lord of the rings trilogy by saying it was just about taking out the trash.
“All we have to do is throw the ring away, easy – peasy”.
Actually, it was easy…I mean, this was something I did while on my first cup of coffee. I started with my flow Mirepoix, input screen, query, output screen.
It’s just the base! You have to liven it up yourself!
To that base, I added in a decision with three outcomes:
1) Input Text “Starts With” “005”
2) Input Text Contains “@”
3) Else assume text is name
These outcomes are each linked to a unique query and assignment:
1) Input Text “Starts With” “005” –> Query ID with Input Text –> varMatchType = “UserID”
2) Input Text Contains “@” –> Query Email with Input Text –> varMatchType = “Email”
3) Else assume text is name –> Query Name with Input Text –> varMatchType = “Name”
I put the varMatchType on as a visual debugger because I only have one output screen and I want to be able to see visually how I got there.
Fun and games aside, how does this work? Well, it works great! Here are some screen shots to prove it:
I would like to think it is because of my super ninja / bow / stealth / flow skills, but the reality is this is just a really good piece of functionality. I really like the potential here. Imagine creating one flow that does this type of analysis and routing…you could use it all over the place!
Hope you enjoyed this…questions or comments, let me know!
Andrew
One thought on “One (Flow) field to rule them all”