{"id":5538,"date":"2020-06-29T04:16:45","date_gmt":"2020-06-29T04:16:45","guid":{"rendered":"https:\/\/www.cloudbyz.com\/blog\/?p=5538"},"modified":"2024-05-28T00:15:44","modified_gmt":"2024-05-28T07:15:44","slug":"salesforce-flows-a-how-to-guide","status":"publish","type":"post","link":"https:\/\/www.cloudbyz.com\/resources\/digital-transformation\/salesforce-flows-a-how-to-guide\/","title":{"rendered":"Salesforce Flows &#8211; A How-to Guide"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"5538\" class=\"elementor elementor-5538\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-6dfb4469 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"6dfb4469\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-5c37d226\" data-id=\"5c37d226\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-4d71cd95 elementor-widget elementor-widget-text-editor\" data-id=\"4d71cd95\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p><!-- wp:paragraph --><\/p>\n<p><span style=\"font-weight: 400;\">In this blog we will learn Salesforce flow and how it is similar to apex coding.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Salesforce flow is a declarative way (Drag &amp; Drop) of implementing an automation that is required for a business process alternative to code.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Blog covers types of flows, elements, resources and good comparison with a sample apex code.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Salesforce flow is a very powerful tool for admins\/developers along with process builders and workflows. New admins\/developers who are learning the Salesforce platform should put Salesforce flow as priority in their learning list.<\/span><\/p>\n<p><b>Where do you find Salesforce Flow to start building one?<\/b><\/p>\n<p><span style=\"font-weight: 400;\">You should be Admin for an org to build salesforce flow, If you are admin please follow this path.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Go to &#8220;Setup&#8221; &#8212;-&gt; Be on the &#8220;Home&#8221; tab &#8212;&gt; Place the cursor on &#8220;Quick Find&#8221; &#8212;&gt; Type &#8220;Flow&#8221;<\/span><\/p>\n<p>\u00a0<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:image {\"align\":\"wide\",\"id\":5539,\"sizeSlug\":\"large\",\"className\":\"is-style-default\"} --><\/p>\n<figure class=\"wp-block-image alignwide size-large is-style-default\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"280\" class=\"wp-image-5539 aligncenter\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-12.24.29-PM-1024x280.png\" alt=\"\" srcset=\"https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-12.24.29-PM-1024x280.png 1024w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-12.24.29-PM-300x82.png 300w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-12.24.29-PM-768x210.png 768w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-12.24.29-PM-1536x420.png 1536w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-12.24.29-PM-2048x560.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:paragraph --><\/p>\n<p><b>Types of Flows<\/b><span style=\"font-weight: 400;\">?<\/span><\/p>\n<p><span style=\"font-weight: 400;\">We have different types in flow for different automation use cases. Salesforce is also improving their flows greatly and providing more options in future.<\/span><\/p>\n<p>\u00a0<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:image {\"align\":\"wide\",\"id\":5542,\"sizeSlug\":\"large\"} --><\/p>\n<figure class=\"wp-block-image alignwide size-large\"><img decoding=\"async\" width=\"1024\" height=\"460\" class=\"wp-image-5542 aligncenter\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-12.36.48-PM-1-1024x460.png\" alt=\"\" srcset=\"https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-12.36.48-PM-1-1024x460.png 1024w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-12.36.48-PM-1-300x135.png 300w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-12.36.48-PM-1-768x345.png 768w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-12.36.48-PM-1-1536x690.png 1536w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-12.36.48-PM-1-2048x920.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p><b>Here are the types:<\/b><span style=\"font-weight: 400;\"> Click on &#8220;New Flow&#8221; you will find above screen.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><b>Screen Flow:<\/b><span style=\"font-weight: 400;\"> In this flow you provide screens to your users to guide them to get information which is required to launch operations based on their input.<\/span><\/li>\n<\/ul>\n<p>\u00a0<\/p>\n<ul>\n<li style=\"font-weight: 400;\"><b>Record &#8211; After Save Updates:<\/b><span style=\"font-weight: 400;\"> Very similar to auto launch flow but gives extra options, if you want to update\/create the records before it has been saved to database or after it has been saved to database. <\/span>Most likely you will find this to be very similar to Apex Trigger events before insert\/update\/delete and after insert\/update\/delete.<\/li>\n<\/ul>\n<p><!-- \/wp:paragraph --><!-- wp:image {\"align\":\"wide\",\"id\":5543,\"sizeSlug\":\"large\"} --><\/p>\n<figure class=\"wp-block-image alignwide size-large\"><img decoding=\"async\" width=\"1024\" height=\"481\" class=\"wp-image-5543 aligncenter\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-12.53.20-PM-1024x481.png\" alt=\"\" srcset=\"https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-12.53.20-PM-1024x481.png 1024w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-12.53.20-PM-300x141.png 300w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-12.53.20-PM-768x361.png 768w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-12.53.20-PM-1536x721.png 1536w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-12.53.20-PM.png 1678w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<p>\u00a0<\/p>\n<p><!-- \/wp:image --><!-- wp:list --><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><b>Scheduled Flow<\/b><span style=\"font-weight: 400;\">: Schedule Jobs are only confined to developers until now. Scheduled flow will help you in achieving this by declarative development. <\/span>Very similar to apex scheduled jobs<\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\"><b>Platform Event Flow:<\/b><span style=\"font-weight: 400;\"> Listening to platform events and doing certain CRED operations is what this flow will help you achieve. <\/span>Let&#8217;s say you have CTI configured your salesforce and now you would like to listen to a call platform event and invoke another apex action.<\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\"><b>Auto Launch Flow:<\/b><span style=\"font-weight: 400;\"> Flow to perform CRED operations similar to Record after save flow without extra options.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Flows can be called via process builder, Auto launch flow will be called via process builder when where you define the criteria to launch the flow.<\/span><\/p>\n<p><b>Deep dive in to Elements &amp; Resources of flow:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">When you select a type of flow and click next you will enter into a screen like below. This is where you will find tools and a canvas to build your logic.<\/span><\/p>\n<p>\u00a0<\/p>\n<p><!-- \/wp:list --><!-- wp:image {\"align\":\"wide\",\"id\":5547,\"sizeSlug\":\"large\"} --><\/p>\n<figure class=\"wp-block-image alignwide size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"585\" class=\"wp-image-5547 aligncenter\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.19.01-PM-1-1024x585.png\" alt=\"\" srcset=\"https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.19.01-PM-1-1024x585.png 1024w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.19.01-PM-1-300x171.png 300w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.19.01-PM-1-768x438.png 768w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.19.01-PM-1-1536x877.png 1536w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.19.01-PM-1-2048x1169.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:paragraph --><\/p>\n<p><span style=\"font-weight: 400;\">As you can see in the above picture, canvas is where you build step by step process. Drag and drop these elements into the canvas to build.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">When your building flows by drag and dropping elements, you will be automatically creating resources which are organized in the &#8220;Manager&#8221; section.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Resources are your variables, data and other materials which will help in achieving your automation process.<\/span><\/p>\n<p><b>Understanding layers of elements &amp; how can I relate them to apex code:<\/b><\/p>\n<p><b>Interactions:<\/b><\/p>\n<ul>\n<li><b>Screen:<\/b><span style=\"font-weight: 400;\"> This will be only available when you select screen flow. You can build a screen by drag &amp; drop in to the canvas and you will find options to place some data types.<\/span><\/li>\n<\/ul>\n<p>\u00a0<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:image {\"align\":\"wide\",\"id\":5550,\"sizeSlug\":\"large\"} --><\/p>\n<figure class=\"wp-block-image alignwide size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"540\" class=\"wp-image-5550 aligncenter\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.42.41-PM-1-1024x540.png\" alt=\"\" srcset=\"https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.42.41-PM-1-1024x540.png 1024w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.42.41-PM-1-300x158.png 300w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.42.41-PM-1-768x405.png 768w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.42.41-PM-1-1536x810.png 1536w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.42.41-PM-1-2048x1080.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<p>\u00a0<\/p>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<ul>\n<li><b>Actions:<\/b><span style=\"font-weight: 400;\"> In this interaction element you can call Apex methods by making them invokable and set the variable and execute them. You can also trigger email alerts.<\/span><\/li>\n<\/ul>\n<p><!-- \/wp:paragraph --><!-- wp:image {\"align\":\"wide\",\"id\":5551,\"sizeSlug\":\"large\"} --><\/p>\n<figure class=\"wp-block-image alignwide size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"542\" class=\"wp-image-5551 aligncenter\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.48.37-PM-1024x542.png\" alt=\"\" srcset=\"https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.48.37-PM-1024x542.png 1024w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.48.37-PM-300x159.png 300w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.48.37-PM-768x406.png 768w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.48.37-PM-1536x813.png 1536w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.48.37-PM.png 1682w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:list --><\/p>\n<ul>\n<li><b>Sub-flow<\/b><span style=\"font-weight: 400;\">: You can call other flows by using sub-flow elements.<\/span><\/li>\n<\/ul>\n<p><!-- \/wp:list --><!-- wp:image {\"align\":\"wide\",\"id\":5552,\"sizeSlug\":\"large\"} --><\/p>\n<figure class=\"wp-block-image alignwide size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"879\" class=\"wp-image-5552 aligncenter\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.59.50-PM-1024x879.png\" alt=\"\" srcset=\"https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.59.50-PM-1024x879.png 1024w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.59.50-PM-300x258.png 300w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.59.50-PM-768x659.png 768w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.59.50-PM-1536x1319.png 1536w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-1.59.50-PM.png 1684w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p><strong>Logic:<\/strong><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:image {\"align\":\"center\",\"id\":5555,\"sizeSlug\":\"large\"} --><\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"114\" height=\"108\" class=\"wp-image-5555 aligncenter\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-2.31.00-PM.png\" alt=\"\" \/><\/figure>\n<\/div>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:list --><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><b>Assignment:<\/b><span style=\"font-weight: 400;\"> Remember when you assign variables with a value within your Apex code. It has a similar function here.<\/span>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">You can assign values to a variable<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">You can assign values to record fields (Single Record Collection)<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">You can assign add\/remove records in record collection variable (Record Collection)<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">In the below code snippet, you can observe that a variable has been declared and assigned with a value. Now, let&#8217;s see how it is similar in Assignments of flow.<\/span><\/p>\n<p><!-- \/wp:list --><!-- wp:preformatted --><\/p>\n<pre class=\"wp-block-preformatted\">String strName = 'My String';  \/\/String variable declaration\nInteger myInteger = 1;         \/\/Integer variable declaration\nBoolean mtBoolean = true;      \/\/Boolean variable declaration<\/pre>\n<p><!-- \/wp:preformatted --><!-- wp:paragraph --><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:image {\"align\":\"wide\",\"id\":5556,\"sizeSlug\":\"large\"} --><\/p>\n<figure class=\"wp-block-image alignwide size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"604\" class=\"wp-image-5556 aligncenter\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-7.57.59-PM-1024x604.png\" alt=\"\" srcset=\"https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-7.57.59-PM-1024x604.png 1024w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-7.57.59-PM-300x177.png 300w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-7.57.59-PM-768x453.png 768w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-7.57.59-PM-1536x905.png 1536w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-7.57.59-PM.png 2012w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:paragraph --><\/p>\n<p><span style=\"font-weight: 400;\">Operator value has more options based on the variable type.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">{!myInteger} &#8211; this is variable which is a resource that has to be created like a record and the screen looks something like this:<\/span><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:image {\"align\":\"wide\",\"id\":5558,\"sizeSlug\":\"large\"} --><\/p>\n<figure class=\"wp-block-image alignwide size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"617\" class=\"wp-image-5558 aligncenter\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-7.56.14-PM-1024x617.png\" alt=\"\" srcset=\"https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-7.56.14-PM-1024x617.png 1024w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-7.56.14-PM-300x181.png 300w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-7.56.14-PM-768x462.png 768w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-7.56.14-PM-1536x925.png 1536w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-7.56.14-PM.png 2006w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<p>\u00a0<\/p>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p><span style=\"font-weight: 400;\">While you are creating resources you can select resource type, there are few options in this and will be explained in my next blog or can get materials from salesforce.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><b>Data Type: <\/b><span style=\"font-weight: 400;\">Variable data type is defined, we also have record as data type to store data of specific objects.<\/span><\/li>\n<li style=\"font-weight: 400;\"><b>API Name:<\/b><span style=\"font-weight: 400;\"> Name what you give to your variable.<\/span><\/li>\n<li style=\"font-weight: 400;\"><b>Allow Multiple Values:<\/b><span style=\"font-weight: 400;\"> Converts a variable into a collection variable where multiple values can be held, this can be used later in a Loop to iterate over the collections.<\/span><\/li>\n<li style=\"font-weight: 400;\"><b>Availability Outside the flow<\/b><span style=\"font-weight: 400;\">: Here you define if a variable will be available outside the flow that your building and how ?<\/span>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">If it is available for input, it will be used as an input variable outside the flow that you are building.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">If it is available for output which means final results which are stored in variables will be available as output to trigger another flow.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!-- \/wp:paragraph --><!-- wp:paragraph --><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:image {\"align\":\"center\",\"id\":5560,\"sizeSlug\":\"large\"} --><\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"102\" height=\"118\" class=\"wp-image-5560 aligncenter\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-8.41.16-PM.png\" alt=\"\" \/><\/figure>\n<p>\u00a0<\/p>\n<\/div>\n<p><!-- \/wp:image --><!-- wp:list --><\/p>\n<ul>\n<li><b>Loop:<\/b><span style=\"font-weight: 400;\"> Remember the below code snippet where you use the &#8220;for&#8221; loop to iterate over collection of items and for each collection you perform an operation.<\/span><\/li>\n<\/ul>\n<p><!-- \/wp:list --><!-- wp:preformatted --><\/p>\n<pre class=\"wp-block-preformatted\">for (APEX_Invoice__c objInvoice: PaidInvoiceNumberList) {\n\n\/\/ Condition to check the current record in context values\nif (objInvoice.APEX_Status__c == 'Paid') {\n\n\/\/ current record on which loop is iterating\nSystem.debug('Value of Current Record on which Loop is iterating is'+objInvoice);\n\n\/\/ if Status value is paid then it will the invoice number into List of String\nInvoiceNumberList.add(objInvoice.Name);\n}\n}<\/pre>\n<p><!-- \/wp:preformatted --><!-- wp:image {\"align\":\"wide\",\"id\":5576,\"sizeSlug\":\"large\"} --><\/p>\n<figure class=\"wp-block-image alignwide size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"669\" class=\"wp-image-5576 aligncenter\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-28-at-12.03.27-AM-1024x669.png\" alt=\"\" srcset=\"https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-28-at-12.03.27-AM-1024x669.png 1024w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-28-at-12.03.27-AM-300x196.png 300w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-28-at-12.03.27-AM-768x502.png 768w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-28-at-12.03.27-AM-1536x1004.png 1536w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-28-at-12.03.27-AM.png 2010w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<p>\u00a0<\/p>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p><span style=\"font-weight: 400;\">Loop will have a collection and then a variable where each record from the collection is taken. Now this single record variable will hold one record at a time.<\/span><\/p>\n<p>\u00a0<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:paragraph --><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:image {\"align\":\"center\",\"id\":5564,\"sizeSlug\":\"large\"} --><\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"202\" height=\"134\" class=\"wp-image-5564 aligncenter\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-9.19.50-PM.png\" alt=\"\" \/><\/figure>\n<\/div>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:list --><\/p>\n<ul>\n<li><b>Decisions: <\/b><span style=\"font-weight: 400;\">Classic if\/else statements that can direct the operations that has to be executed based on certain condition<\/span><\/li>\n<\/ul>\n<p><!-- \/wp:list --><!-- wp:preformatted --><\/p>\n<pre class=\"wp-block-preformatted\">if boolean_expression {\n   \/* statement(s) will execute if the boolean expression is true *\/\n} else {\n   \/* statement(s) will execute if the boolean expression is false *\/\n}<\/pre>\n<p><!-- \/wp:preformatted --><!-- wp:paragraph --><\/p>\n<p><span style=\"font-weight: 400;\">But in flow&#8217;s decision element along with your if else statements, there is a default outcome statement, where when none of the criteria is met it will be executed. This is how it might look in full conditions.<\/span><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:image {\"id\":5566,\"sizeSlug\":\"large\"} --><\/p>\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"775\" height=\"1024\" class=\"wp-image-5566 aligncenter\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-9.27.11-PM-775x1024.png\" alt=\"\" srcset=\"https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-9.27.11-PM-775x1024.png 775w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-9.27.11-PM-227x300.png 227w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-9.27.11-PM-768x1014.png 768w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-9.27.11-PM.png 942w\" sizes=\"(max-width: 775px) 100vw, 775px\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:image {\"align\":\"wide\",\"id\":5565,\"sizeSlug\":\"large\"} --><\/p>\n<figure class=\"wp-block-image alignwide size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"615\" class=\"wp-image-5565 aligncenter\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-9.27.02-PM-1024x615.png\" alt=\"\" srcset=\"https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-9.27.02-PM-1024x615.png 1024w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-9.27.02-PM-300x180.png 300w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-9.27.02-PM-768x461.png 768w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-9.27.02-PM-1536x923.png 1536w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-9.27.02-PM-2048x1231.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<p>\u00a0<\/p>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p><strong>Data:<\/strong><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:paragraph --><\/p>\n<p><span style=\"font-weight: 400;\">Data in flows are very similar to your Apex SOQL operations like getting data and later you have your DML operations like Update, Delete, Create.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Data can be collected in with specific conditions or just get all the data and the same applies to your DML operations like Update, Delete, Create.<\/span><\/p>\n<p>\u00a0<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:image {\"id\":5567,\"sizeSlug\":\"large\"} --><\/p>\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"374\" height=\"364\" class=\"wp-image-5567 aligncenter\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-9.32.24-PM.png\" alt=\"\" srcset=\"https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-9.32.24-PM.png 374w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-9.32.24-PM-300x292.png 300w\" sizes=\"(max-width: 374px) 100vw, 374px\" \/><\/figure>\n<p>\u00a0<\/p>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p><strong>Re-Imagining Apex code in Salesforce flow:<\/strong><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:paragraph --><\/p>\n<p><span style=\"font-weight: 400;\">We will take a piece of code and re-imagine that same code in flow. I will be using &#8220;Auto launch flow&#8221;.<\/span><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:preformatted --><\/p>\n<div>\n<div>\n<pre>\/\/ Initializing the custom object records list to store the Invoice Records created today<br \/><br \/>List  PaidInvoiceNumberList = new List  ();<br \/><br \/>\/\/ SOQL query which will fetch the invoice records which has been created today<br \/><br \/>PaidInvoiceNumberList = [SELECT Id,Name, APEX_Status__c,Paid_Date__c FROM APEX_Invoice__c WHERE<br \/><br \/>   CreatedDate = System.today()];<br \/><br \/>\/\/ List to store the Invoice Number of Paid invoices<br \/><br \/>List  InvoiceNumberList = new List  ();<br \/><br \/>\/\/ This loop will iterate on the List PaidInvoiceNumberList and will process each record<br \/><br \/>for (APEX_Invoice__c objInvoice: PaidInvoiceNumberList) {<br \/><br \/>   \/\/ Condition to check the current record in context values<br \/><br \/>   if (objInvoice.APEX_Status__c == 'Paid') {<br \/><br \/>       \/\/ if Status value is paid then it will update the paid date to systems today's date<br \/><br \/>      objInvoice.Paid_Date__c = System.today();<br \/><br \/>      \/\/ current record on which loop is iterating<br \/><br \/>      System.debug('Value of Current Record on which Loop is iterating is'+objInvoice);<br \/><br \/>      \/\/ if Status value is paid then it will the invoice number into List of String<br \/><br \/>      InvoiceNumberList.add(objInvoice);<br \/><br \/>   }<br \/><br \/>}<br \/><br \/>if(InvoiceNumberList.size() &gt; 0) {<br \/><br \/>    Update InvoiceNumberList;<br \/>}<\/pre>\n<\/div>\n<\/div>\n<p><!-- \/wp:preformatted --><!-- wp:paragraph --><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:paragraph --><\/p>\n<p><strong>Decoding of Apex:<\/strong><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:preformatted --><\/p>\n<pre class=\"wp-block-preformatted\">\/\/ SOQL query which will fetch the invoice records which has been created today<br \/><br \/>PaidInvoiceNumberList = [SELECT Id,Name, APEX_Status__c,Paid_Date__c FROM APEX_Invoice__c WHERE CreatedDate = System.today()];<\/pre>\n<p><!-- \/wp:preformatted --><!-- wp:paragraph --><\/p>\n<p><span style=\"font-weight: 400;\">We will have to get invoice records from the Invoice object with a condition as mentioned in SOQL query. <\/span><span style=\"font-weight: 400;\">Drag the &#8220;Get Records&#8221; element into the canvas and give information accordingly. As we are getting all the records, flow will automatically create a record collection and store all field values or just like in the above SOQL query you can choose specific fields. I choose Automatically store all fields.<\/span><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:paragraph \/--><!-- wp:image {\"align\":\"wide\",\"id\":5569,\"sizeSlug\":\"large\"} --><\/p>\n<figure class=\"wp-block-image alignwide size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"734\" class=\"wp-image-5569 aligncenter\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-11.09.52-PM-1024x734.png\" alt=\"\" srcset=\"https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-11.09.52-PM-1024x734.png 1024w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-11.09.52-PM-300x215.png 300w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-11.09.52-PM-768x550.png 768w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-11.09.52-PM-1536x1100.png 1536w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-11.09.52-PM.png 2010w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<p>\u00a0<\/p>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:preformatted --><\/p>\n<pre class=\"wp-block-preformatted\">\/\/ This loop will iterate on the List PaidInvoiceNumberList and will process each record<br \/><br \/>for (APEX_Invoice__c objInvoice: PaidInvoiceNumberList) {<br \/><br \/>\/\/ Condition to check the current record in context values<br \/><br \/>if (objInvoice.APEX_Status__c == 'Paid') {<br \/><br \/>\/\/ if Status value is paid then it will update the paid date to systems today's date<br \/><br \/>objInvoice.Paid_Date__c = System.today();<br \/><br \/>\/\/ current record on which loop is iterating<br \/><br \/>System.debug('Value of Current Record on which Loop is iterating is'+objInvoice);<br \/><br \/>\/\/ if Status value is paid then it will the invoice number into List of String<br \/><br \/>InvoiceNumberList.add(objInvoice);<br \/><br \/>}<\/pre>\n<p><!-- \/wp:preformatted --><!-- wp:paragraph --><\/p>\n<p><span style=\"font-weight: 400;\">In this block of code they are initiating a loop and checking each record in the loop where status is &#8220;Paid.&#8221; Let&#8217;s see how it is done in flow.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">First we have the Loop element and define record collection variable and loop variable which hold a single record at a time.<\/span><\/p>\n<p>\u00a0<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:image {\"align\":\"wide\",\"id\":5570,\"sizeSlug\":\"large\"} --><\/p>\n<figure class=\"wp-block-image alignwide size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"668\" class=\"wp-image-5570 aligncenter\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-11.15.23-PM-1024x668.png\" alt=\"\" srcset=\"https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-11.15.23-PM-1024x668.png 1024w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-11.15.23-PM-300x196.png 300w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-11.15.23-PM-768x501.png 768w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-11.15.23-PM-1536x1003.png 1536w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-11.15.23-PM.png 2010w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<p>\u00a0<\/p>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p><span style=\"font-weight: 400;\">Now, we will have a Decision element to check for records with status.<\/span><\/p>\n<p>\u00a0<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:image {\"align\":\"wide\",\"id\":5571,\"sizeSlug\":\"large\"} --><\/p>\n<figure class=\"wp-block-image alignwide size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"514\" class=\"wp-image-5571 aligncenter\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-11.18.17-PM-1024x514.png\" alt=\"\" srcset=\"https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-11.18.17-PM-1024x514.png 1024w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-11.18.17-PM-300x151.png 300w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-11.18.17-PM-768x385.png 768w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-11.18.17-PM-1536x771.png 1536w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-11.18.17-PM-2048x1027.png 2048w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-27-at-11.18.17-PM-585x295.png 585w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<p>\u00a0<\/p>\n<p><!-- \/wp:image --><!-- wp:preformatted --><\/p>\n<pre class=\"wp-block-preformatted\">\/\/ if Status value is paid then it will update the paid date to systems today's date<br \/><br \/>objInvoice.Paid_Date__c = System.today();<br \/><br \/>\/\/ if Status value is paid then it will the invoice number into List of String<br \/><br \/>InvoiceNumberList.add(objInvoice);<\/pre>\n<p><!-- \/wp:preformatted --><!-- wp:paragraph --><\/p>\n<p><span style=\"font-weight: 400;\">For the records where if condition is satisfied status is equal to paid are updated with paid date field equals to today&#8217;s date and add the records to a list called &#8220;InvoiceNumberList&#8221; here these will be a record collection resource. Let&#8217;s see how this is executed in flow.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">First we have to update the Paid Date field to today&#8217;s date and we have to create a resource &#8220;InvoiceNumberList&#8221; record collection and then use assignment to add the records which meet status paid into the collection.<\/span><\/p>\n<p><a href=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.33.03-AM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-5599 size-large\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.33.03-AM-1024x475.png\" alt=\"\" width=\"1024\" height=\"475\" srcset=\"https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.33.03-AM-1024x475.png 1024w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.33.03-AM-300x139.png 300w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.33.03-AM-768x357.png 768w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.33.03-AM-1536x713.png 1536w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.33.03-AM.png 2012w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.34.33-AM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-5600 size-large\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.34.33-AM-1024x471.png\" alt=\"\" width=\"1024\" height=\"471\" srcset=\"https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.34.33-AM-1024x471.png 1024w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.34.33-AM-300x138.png 300w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.34.33-AM-768x353.png 768w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.34.33-AM-1536x707.png 1536w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.34.33-AM.png 2012w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>\u00a0<\/p>\n<p>Now we have to update the list as per the code, it is checking if the list size is greater than zero or not, in flow you can check if the list is not null.<\/p>\n<pre>if(InvoiceNumberList.size() &gt; 0) {<br \/><br \/>Update InvoiceNumberList;<br \/><br \/>}<\/pre>\n<p><!-- \/wp:paragraph --><!-- wp:image {\"align\":\"wide\",\"id\":5572,\"sizeSlug\":\"large\"} --><\/p>\n<p><!-- \/wp:image --><!-- wp:image {\"align\":\"wide\",\"id\":5573,\"sizeSlug\":\"large\"} --><\/p>\n<p>\u00a0<\/p>\n<p>Drag &amp; drop the Decision element.<\/p>\n<p><a href=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.35.41-AM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-5603\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.35.41-AM-1024x514.png\" alt=\"\" width=\"1024\" height=\"514\" srcset=\"https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.35.41-AM-1024x514.png 1024w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.35.41-AM-300x151.png 300w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.35.41-AM-768x386.png 768w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.35.41-AM-1536x771.png 1536w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.35.41-AM-2048x1028.png 2048w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.35.41-AM-585x295.png 585w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>\u00a0<\/p>\n<p>Now drag &amp; drop the Update Records element, In this element you can select the whole list and update the records.<\/p>\n<p>\u00a0<\/p>\n<p><a href=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.36.28-AM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-5604\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.36.28-AM-1024x568.png\" alt=\"\" width=\"1024\" height=\"568\" srcset=\"https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.36.28-AM-1024x568.png 1024w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.36.28-AM-300x167.png 300w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.36.28-AM-768x426.png 768w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.36.28-AM-1536x853.png 1536w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.36.28-AM.png 2014w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">Now lets see how flow looks.<\/span><\/p>\n<p>\u00a0<\/p>\n<p><a href=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.36.49-AM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-5605\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.36.49-AM-1024x582.png\" alt=\"\" width=\"1024\" height=\"582\" srcset=\"https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.36.49-AM-1024x582.png 1024w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.36.49-AM-300x170.png 300w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.36.49-AM-768x436.png 768w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.36.49-AM-1536x873.png 1536w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-10.36.49-AM-2048x1163.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>\u00a0<\/p>\n<pre>System.debug('Value of Current Record on which Loop is iterating is'+objInvoice);<\/pre>\n<p>Just like in\u00a0 Apex code where you can debug. Same feature is available in flows, before activating the flow i recommend you to debug your flow.<\/p>\n<p><a href=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-4.15.16-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-5615\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-4.15.16-PM-1024x221.png\" alt=\"\" width=\"1024\" height=\"221\" srcset=\"https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-4.15.16-PM-1024x221.png 1024w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-4.15.16-PM-300x65.png 300w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-4.15.16-PM-768x165.png 768w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-4.15.16-PM-1536x331.png 1536w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-4.15.16-PM-2048x441.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-4.15.34-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-5614\" src=\"https:\/\/www.cloudbyz.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-4.15.34-PM-1024x523.png\" alt=\"\" width=\"1024\" height=\"523\" srcset=\"https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-4.15.34-PM-1024x523.png 1024w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-4.15.34-PM-300x153.png 300w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-4.15.34-PM-768x392.png 768w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-4.15.34-PM-1536x784.png 1536w, https:\/\/www.cloudbyz.com\/resources\/wp-content\/uploads\/2020\/06\/Screenshot-2020-06-29-at-4.15.34-PM-2048x1045.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p><!-- \/wp:image --><!-- wp:image {\"align\":\"wide\",\"id\":5577,\"sizeSlug\":\"large\"} --><\/p>\n<figure class=\"wp-block-image alignwide size-large\"><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:paragraph --><\/p>\n<p><strong>Conclusion:<\/strong><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:paragraph --><\/p>\n<p>Hope this give&#8217;s good understanding of Salesforce flows. Will meet you guys next time with another topic.<\/p>\n<p><!-- \/wp:paragraph --><\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>In this blog we will learn Salesforce flow and how it is similar to apex coding. Salesforce flow is a declarative way (Drag &amp; Drop) of implementing an automation that is required for a business process alternative to code. Blog covers types of flows, elements, resources and good comparison with a sample apex code. Salesforce [&hellip;]<\/p>\n","protected":false},"author":32,"featured_media":8517,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"0","ocean_custom_header_template":"0","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"0","ocean_menu_typo_font_family":"0","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"0","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"off","ocean_gallery_id":[],"footnotes":"","spc_primary_category":0},"categories":[267,3,166],"tags":[193,191,48,192,145,194,189,190],"acf":[],"aioseo_notices":[],"secondary_thumbnail":null,"_links":{"self":[{"href":"https:\/\/www.cloudbyz.com\/resources\/wp-json\/wp\/v2\/posts\/5538"}],"collection":[{"href":"https:\/\/www.cloudbyz.com\/resources\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cloudbyz.com\/resources\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudbyz.com\/resources\/wp-json\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudbyz.com\/resources\/wp-json\/wp\/v2\/comments?post=5538"}],"version-history":[{"count":1,"href":"https:\/\/www.cloudbyz.com\/resources\/wp-json\/wp\/v2\/posts\/5538\/revisions"}],"predecessor-version":[{"id":16717,"href":"https:\/\/www.cloudbyz.com\/resources\/wp-json\/wp\/v2\/posts\/5538\/revisions\/16717"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cloudbyz.com\/resources\/wp-json\/wp\/v2\/media\/8517"}],"wp:attachment":[{"href":"https:\/\/www.cloudbyz.com\/resources\/wp-json\/wp\/v2\/media?parent=5538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cloudbyz.com\/resources\/wp-json\/wp\/v2\/categories?post=5538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cloudbyz.com\/resources\/wp-json\/wp\/v2\/tags?post=5538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}