Adding the Loop element to a Flow

The Loop element is used to check each item in a collection variable and execute an action on it. For example, you can use the Loop element to store SObject Collection variable values into a Loop variable, that is, SObject variable, and both must have the same object as the collection. You can also use the Loop element to examine the collection variable (data type text) and copy its value into a Text variable.

If the SObject Collection variable is not null, it means that the old Opportunity record has some followers. We will use the Loop element to extract records from the SObject Collection variable (SocvOld_Opportuntiy_Followers) and store it to the SObject variable (SovIndividual_Follower_Details):

  1. Click on the Palette tab and drag and drop the Loop element onto the Flow canvas. It will open a new window for you, where you have to enter the following details:
    • Name: Enter the name for the Loop element. In this case, enter Name as Extract each followers.
    • Unique Name: This will be autopopulated based on the name.
    • Description: Write some meaningful text so that another developer/administrator can easily understand why this Loop was created. When you select Loop in the Explorer tab, the description appears in the Description pane.
    • Loop through: In the Assignments section, select the collection or SObject Collection variable you want to loop through. In this case, select the SObject Collection variable {!SocvOld_Opportuntiy_Followers}. Select the order as Ascending in order to loop through the collection.
    • Loop Variable: Select SObject variable or variable as a Loop variable. In this case, select SObject variable. {!SovIndividual_Follower_Details} as the Loop Variable.

For more details, refer to the following screenshot:

  1. Once you are done, click on the OK button.
  2. To add followers to a record, two things are required: one is Subscriber Id (user ID) and the other is Parent ID (record ID). The SObject Variable SovIndividual_Follower_Details already has a user ID, so we will assign a new Opportunity ID to the Parent ID field using the Assignment element.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.197.212