Loop Variable not an available in loop element - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Marketing MktOpsMarketing MktOps 

Loop Variable not an available in loop element

I am trying to create a flow to create a renewal opportunity with line items and really struggling to find clear/ up to date instructions. 

I am following this setup,
https://trailhead.salesforce.com/en/content/learn/modules/business_process_automation/business_process_automation_combined

but I am stuck when it gets to this point, 

Drag a Loop element onto the canvas, and set these values.
In Label, name it Iterate Over Products.
For Collection Variable, select RECORD COLLECTION VARIABLES | oppProducts_Original.
This option tells the loop which collection to iterate over when assigning items to the loop variable.
For Loop Variable, select New Resource and set these values

There is no Loop Variable option available. Any pointers on what I'm doing wrong here? 

User-added image

 
Best Answer chosen by Marketing MktOps
Ankush AgarwalAnkush Agarwal
Hi,

Your Org is updated with Summer20 release and this new release does not require to create a new resource for loop variable.

You may use "Current Item from Loop OppProducts_Original" as loop variable. You can notice an informative block at the bottom of your screenshot


Please refer below link:

https://releasenotes.docs.salesforce.com/en-us/summer20/release-notes/rn_forcecom_flow_fbuilder_auto_output_loop.htm

All Answers

Ankush AgarwalAnkush Agarwal
Hi,

Your Org is updated with Summer20 release and this new release does not require to create a new resource for loop variable.

You may use "Current Item from Loop OppProducts_Original" as loop variable. You can notice an informative block at the bottom of your screenshot


Please refer below link:

https://releasenotes.docs.salesforce.com/en-us/summer20/release-notes/rn_forcecom_flow_fbuilder_auto_output_loop.htm
This was selected as the best answer
sakshi nagpalsakshi nagpal
 Suppose this is a for loop
OppProducts_Original is equivalen to contactList
for(Contact con : contactList){
}

 API name of loop, stores the each item.
API_Name.field_Name can be used in loop  as loop variable

let me know if you hve more questions




 Thanks,
Sakshi
Marketing MktOpsMarketing MktOps
Many thanks for both your answers! Really appreciated