In Automation, Flow, Wizard's Apprentice

Visual Workflow: Loops, Assignments, and Fast Elements

In Episode 3,Power of the Flow, we looked out how our end users can use Visual Workflow.

This episode we examine Loops including the Loop Element. We also look at using the Assignment, Fast Create, and Fast Lookup elements. Prepare to be loopy!

Recommended Posts
Showing 5 comments
  • Joe DeSouza
    Reply

    Great Video Series…Since you asked for ideas, how about a video on passing variable values from Process Builder to Flow for use. Feel free to e-mail me if you’re interested in hearing details of my specific application.

    • Brian Kwong
      Reply

      It is a good idea Joe. I’m planning on going doing just that which is why I started the process builder series now do we can run in tandem

    • Brian Kwong
      Reply

      Joe,

      It’s a great idea and it’s something I have planned. It was tough because it belongs both in the Flow and Process Builder line. That’s one of the reasons I started the Process builder series now so I can tie the two together.

  • Jen
    Reply

    Hey Brian,

    Do you have more documentation/notes on why and how you used assignments after the loop? I found your video very helpful but unsure about the assignment part.

    Thanks!

    • Brian Kwong
      Reply

      Jen,

      The assignment element allows you to set or change the values to variables. This includes fields from an sObject Variable.

      The loop element is used with sObject Collection and an sObject variable. A good metaphor I’ve heard is think of the sObject variable like a CD. That represents a single salesforce record with multiple pieces of information (Fields). A sObject Collection is the equivalent to a CD spindle. It hold multiple records (with their corresponding fields). The loop element in this metaphor would be like a CD changer, a machine that can take the CD spindle and take 1 CD at the time, play the CD, then throw the CD away before replacing it with a new one from the spindle.

      Typically a flow is setup like this: A fast lookup which populates a sObject collection. A Loop which takes each record in the sobject collection and passes it to an sObject Variable, an Assignment which does something with the data from the sObject Variable and then a Fast Element (update/Create) when the loop is completed.

      The assignment can be used for Defining a NEW record based on information from an OLD record (that’s the one in the loop). An assignment can also be used to add a NEW or OLD record to a different sObject Collection. This collection holds any records that will be created or updated after the loop. The reason to use a separate collection is to keep them cleanly separated from the records in the other sObject Collection.

      I’ll be making a new video that try to clear this up.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.