EP - 12 | LOOP AND ASSIGNMENT ELEMENT | LIGHTNING FLOW SERIES⚡️
Вставка
- Опубліковано 11 вер 2024
- In this video you will learn how to use loop and assignment elements. In this example we are creating a loop for accounts and checking if the account has any contact, If not we are creating contact for them using assignment element.
Hope you guys are liking this series and it's helpful for you.
Let's learn and grow together.
Here is the playlist of LIGHTNING FLOW SERIES so if you have missed any episode you can watch it here.
• Lightning Flows
#AssignmentElement #LoopElement #FlowTutorial #LightningFlowSeries #LightningFlowTutorial #NoCode #assignment #loop
Thank you it helped me resolve one issue
How to run loop for constant value such as i have to run loop 5 times?
Hi,
you are using here get element in loop , can you please confirm here get element consume soql but we are avoid soql in for loop in apex side, so here it's good ?? may be it is bad practice can you please confirm?
Hey Shakti, We should avoid DML as much as we can but in this case we need to check contacts for every account So I feel this is the appropriate way to do that.
If you know any other better way of doing this example, Do let me know i'll implement it for sure. Thanks!
In the GetRecords(Accounts) we can directly get the records whose haven't contacts by using filter condition directly
hi monicka ,after the decision(checking the contact),you are assigning the variable in single variable resource and again assigning the record collection variable..instead of that can we go directly in record collection variable?
Hey Prasanth, thank you for connecting me on LinkedIn.
As we discussed i will create a video on that so, you and other great learners like you won't feel confused.
Stay connected.
HI Monica .
thanks for ur videos ...
i have 100s of accounts when i have tried to execute this flow it has thrown error I.E. soql hit limit. do you have any other way to create this ? please let us know.
Hey Thank you for reaching out. I will search about it and will let you know. Till then you can definitely achieve this with apex.
hi..thinking this would happen . I tried with some conditions like industry= media in get accounts element ..it worked successfully.(rest of flow is same as in vedio)
in UI part after run i found records with no contact now got created 1 contact (only for the accounts whose industry is media)
That's a great idea. You can add conditions and filter your get record element.
Thanks for another good video. Would it be possible to use Get Contact element outside of loop...right after get account ? Will it work ?
Hey Mayank, Thank you for your appreciation.
No it will not give us the same result because we want to get contact for each account one by one to check if a contact exists for that particular account or not. If we will use Get Contact outside loop it will not be able to get contact for a list of accounts, right? that's why we have added it in accounts loop.