home.social

#antipattern — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #antipattern, aggregated by home.social.

fetched live
  1. Diese nervigen "Ermahnmails" Wissensdatenbankeinträge aktuell zu halten die dann nichtmal der Helpdesk selbst liest fördert die Abneigung Wissensdatenbankeinträge zu erstellen. #antipattern

  2. Diese nervigen "Ermahnmails" Wissensdatenbankeinträge aktuell zu halten die dann nichtmal der Helpdesk selbst liest fördert die Abneigung Wissensdatenbankeinträge zu erstellen. #antipattern

  3. Diese nervigen "Ermahnmails" Wissensdatenbankeinträge aktuell zu halten die dann nichtmal der Helpdesk selbst liest fördert die Abneigung Wissensdatenbankeinträge zu erstellen. #antipattern

  4. I just pushed directly to main, brrrr☠️

    its just share notes, but anyways....

    #git #antipattern

  5. @andre
    Insofern bin ich den Herren #Trump, #Merz, #Klingbeil, #Scholz und #Lindner sowie den Frauen #Bas und Weidel sehr dankbar.
    Sie alle zeigen uns täglich, was passiert, wenn sicher geglaubte #Gewissheiten ausbleiben.

    Deren #Antipattern hat uns in der #Zeit der Frau #Merkel zu lang gefehlt.
    Es ging uns zu lange zu gut.

  6. A problem I've been seeing a bit more often recently is folk using tools/frameworks/artefacts intended for collaboration solo — and failing miserably. Anybody else? adrianhoward.com/posts/the-pus

    #collaboration #antipattern

  7. A problem I've been seeing a bit more often recently is folk using tools/frameworks/artefacts intended for collaboration solo — and failing miserably. Anybody else? adrianhoward.com/posts/the-pus

    #collaboration #antipattern

  8. A problem I've been seeing a bit more often recently is folk using tools/frameworks/artefacts intended for collaboration solo — and failing miserably. Anybody else? adrianhoward.com/posts/the-pus

    #collaboration #antipattern

  9. A problem I've been seeing a bit more often recently is folk using tools/frameworks/artefacts intended for collaboration solo — and failing miserably. Anybody else? adrianhoward.com/posts/the-pus

    #collaboration #antipattern

  10. Why do maps insist on the tiniest font possible even when you zoom in?

    I didn't zoom to try to see each groove in the asphalt, I was trying to read the street names

    #maps #AntiPattern #accessibility

  11. Why do maps insist on the tiniest font possible even when you zoom in?

    I didn't zoom to try to see each groove in the asphalt, I was trying to read the street names

    #maps #AntiPattern #accessibility

  12. Why do maps insist on the tiniest font possible even when you zoom in?

    I didn't zoom to try to see each groove in the asphalt, I was trying to read the street names

    #maps #AntiPattern #accessibility

  13. Why do maps insist on the tiniest font possible even when you zoom in?

    I didn't zoom to try to see each groove in the asphalt, I was trying to read the street names

    #maps #AntiPattern #accessibility

  14. Those #mobile apps (so, on a small screen) embedding photos but not letting you zoom in...
    In news apps this is even wasting the #photograph's work.

    #AntiPattern

  15. D'ailleurs c'est différent sur #Mac et #iOS, on est connecté à partir du moment où a validé les CGU.
    Encore un #AntiPattern au passage : servir du contenu différent selon le user-agent...

  16. D'ailleurs c'est différent sur #Mac et #iOS, on est connecté à partir du moment où a validé les CGU.
    Encore un #AntiPattern au passage : servir du contenu différent selon le user-agent...

  17. #SNCF a encore frappé. Dans une mise à jour récente de l'appli #Android il faut cliquer sur le (seul) bouton "copier dans le presse-papier" pour se connecter. Ben non. #AntiPattern. C'est intrusif, tu écrases ce que je venais patiemment d'y copier juste avant d'avoir eu besoin du réseau...

  18. #SNCF a encore frappé. Dans une mise à jour récente de l'appli #Android il faut cliquer sur le (seul) bouton "copier dans le presse-papier" pour se connecter. Ben non. #AntiPattern. C'est intrusif, tu écrases ce que je venais patiemment d'y copier juste avant d'avoir eu besoin du réseau...

  19. I hate apps that remove actual useful timestamps and replace them with a vague "one month ago." In what way is that helpful? I've been to school, so calendar arithmetic is not a problem. Just tell me the date and time of the item, and if I need to have an estimate of how long ago that was I can do it myself. Even better, I can screenshot an item and in five years time that screenshot with its timestamp will still tell me everything I need to know.

    #antipattern

  20. I hate apps that remove actual useful timestamps and replace them with a vague "one month ago." In what way is that helpful? I've been to school, so calendar arithmetic is not a problem. Just tell me the date and time of the item, and if I need to have an estimate of how long ago that was I can do it myself. Even better, I can screenshot an item and in five years time that screenshot with its timestamp will still tell me everything I need to know.

    #antipattern

  21. > One programming trend that surpised me a lot recently, something that happens both at work and in open-source, is people suddenly starting doing the following: …

    #ai #dev #blog #concerns #antipattern

    keleshev.com/ai-equals-true-is

  22. > One programming trend that surpised me a lot recently, something that happens both at work and in open-source, is people suddenly starting doing the following: …

    #ai #dev #blog #concerns #antipattern

    keleshev.com/ai-equals-true-is

  23. > One programming trend that surpised me a lot recently, something that happens both at work and in open-source, is people suddenly starting doing the following: …

    #ai #dev #blog #concerns #antipattern

    keleshev.com/ai-equals-true-is

  24. 17% Zielerreichung im Sprint? @peterbittner berichtet aus der Hölle der "Busy Work". Wenn fast alles in den nächsten Sprint schwappt, habt ihr keinen Plan, sondern nur Hoffnung. "Spillover" ist zum Modewort verkommen, um Inkompetenz bei der Arbeitspaketierung zu kaschieren. Nutzt verdammt noch mal Kanban, wenn ihr nicht planen könnt, statt Scrum zu verbiegen.

    🔗 mastodon.social/@peterbittner/

    Wie hoch ist eure "Spillover-Quote"?

    #Kanban #AntiPattern #Scrum

    3/4

  25. 17% Zielerreichung im Sprint? @peterbittner berichtet aus der Hölle der "Busy Work". Wenn fast alles in den nächsten Sprint schwappt, habt ihr keinen Plan, sondern nur Hoffnung. "Spillover" ist zum Modewort verkommen, um Inkompetenz bei der Arbeitspaketierung zu kaschieren. Nutzt verdammt noch mal Kanban, wenn ihr nicht planen könnt, statt Scrum zu verbiegen.

    🔗 mastodon.social/@peterbittner/

    Wie hoch ist eure "Spillover-Quote"?

    #Kanban #AntiPattern #Scrum

    3/4

  26. 17% Zielerreichung im Sprint? @peterbittner berichtet aus der Hölle der "Busy Work". Wenn fast alles in den nächsten Sprint schwappt, habt ihr keinen Plan, sondern nur Hoffnung. "Spillover" ist zum Modewort verkommen, um Inkompetenz bei der Arbeitspaketierung zu kaschieren. Nutzt verdammt noch mal Kanban, wenn ihr nicht planen könnt, statt Scrum zu verbiegen.

    🔗 mastodon.social/@peterbittner/

    Wie hoch ist eure "Spillover-Quote"?

    #Kanban #AntiPattern #Scrum

    3/4

  27. 17% Zielerreichung im Sprint? @peterbittner berichtet aus der Hölle der "Busy Work". Wenn fast alles in den nächsten Sprint schwappt, habt ihr keinen Plan, sondern nur Hoffnung. "Spillover" ist zum Modewort verkommen, um Inkompetenz bei der Arbeitspaketierung zu kaschieren. Nutzt verdammt noch mal Kanban, wenn ihr nicht planen könnt, statt Scrum zu verbiegen.

    🔗 mastodon.social/@peterbittner/

    Wie hoch ist eure "Spillover-Quote"?

    #Kanban #AntiPattern #Scrum

    3/4

  28. @heisedeveloper Es klingt zwar lustig, aber:

    Gleitkommazahlen zu benutzen ist ein #Antipattern.

    Man muss verstehen, was das bedeutet/impliziert und welche Risiken entstehen. Das tut meiner Erfahrung nach keiner. Insbesondere machen sich Wissenschaftler zu wenig Gedanken über die Ungenauigkeiten.

    Und nein, mehr Bits helfen nicht wirklich.

  29. @heisedeveloper Es klingt zwar lustig, aber:

    Gleitkommazahlen zu benutzen ist ein #Antipattern.

    Man muss verstehen, was das bedeutet/impliziert und welche Risiken entstehen. Das tut meiner Erfahrung nach keiner. Insbesondere machen sich Wissenschaftler zu wenig Gedanken über die Ungenauigkeiten.

    Und nein, mehr Bits helfen nicht wirklich.

  30. @heisedeveloper Es klingt zwar lustig, aber:

    Gleitkommazahlen zu benutzen ist ein #Antipattern.

    Man muss verstehen, was das bedeutet/impliziert und welche Risiken entstehen. Das tut meiner Erfahrung nach keiner. Insbesondere machen sich Wissenschaftler zu wenig Gedanken über die Ungenauigkeiten.

    Und nein, mehr Bits helfen nicht wirklich.

  31. @heisedeveloper Es klingt zwar lustig, aber:

    Gleitkommazahlen zu benutzen ist ein #Antipattern.

    Man muss verstehen, was das bedeutet/impliziert und welche Risiken entstehen. Das tut meiner Erfahrung nach keiner. Insbesondere machen sich Wissenschaftler zu wenig Gedanken über die Ungenauigkeiten.

    Und nein, mehr Bits helfen nicht wirklich.

  32. Teil der Definition ist die Abgrenzung.

    Das Gegenteil ist ein plangetriebener Ansatz. Er geht von der Illusion aus, man könne Komplexität durch einen perfekten Plan am Anfang beherrschen. Er optimiert für Vorhersagbarkeit in einer Welt, die nicht vorhersagbar ist.

    4/5

    #Wasserfall #Projektmanagement #AntiPattern #Planung

  33. Teil der Definition ist die Abgrenzung.

    Das Gegenteil ist ein plangetriebener Ansatz. Er geht von der Illusion aus, man könne Komplexität durch einen perfekten Plan am Anfang beherrschen. Er optimiert für Vorhersagbarkeit in einer Welt, die nicht vorhersagbar ist.

    4/5

    #Wasserfall #Projektmanagement #AntiPattern #Planung

  34. Teil der Definition ist die Abgrenzung.

    Das Gegenteil ist ein plangetriebener Ansatz. Er geht von der Illusion aus, man könne Komplexität durch einen perfekten Plan am Anfang beherrschen. Er optimiert für Vorhersagbarkeit in einer Welt, die nicht vorhersagbar ist.

    4/5

    #Wasserfall #Projektmanagement #AntiPattern #Planung

  35. Teil der Definition ist die Abgrenzung.

    Das Gegenteil ist ein plangetriebener Ansatz. Er geht von der Illusion aus, man könne Komplexität durch einen perfekten Plan am Anfang beherrschen. Er optimiert für Vorhersagbarkeit in einer Welt, die nicht vorhersagbar ist.

    4/5

    #Wasserfall #Projektmanagement #AntiPattern #Planung

  36. Å som jeg hater nettbutikker med "Last mer" knapp. Jeg gir opp ganske fort. Og hvis du klikker inn på et produkt og går tilbake igjen, så starter de ofte på toppen igjen. Noen har ikke en gang indikasjon på hvor mange produkter de har igjen å vise.

    #nettbutikk #AntiPattern #NorskTut

  37. Copy.
    qrscanner.net
    Paste.
    to the rescue.

    Of course their website also points to an app only.

    #antipattern

    No thanks.

    What if I have a #linux #pinephone or something?

    What if I have a #degoogled phone?

    And the funny thing is, the app is probably just a wrapped web-page when you actually go download it. Which I won't be doing.

    I'll put in a service request and waist the vendor's time instead. Because I can. This is not good customer service.

    I want to like alchitry.com

  38. Copy.
    qrscanner.net
    Paste.
    to the rescue.

    Of course their website also points to an app only.

    #antipattern

    No thanks.

    What if I have a #linux #pinephone or something?

    What if I have a #degoogled phone?

    And the funny thing is, the app is probably just a wrapped web-page when you actually go download it. Which I won't be doing.

    I'll put in a service request and waist the vendor's time instead. Because I can. This is not good customer service.

    I want to like alchitry.com

  39. Copy.
    qrscanner.net
    Paste.
    to the rescue.

    Of course their website also points to an app only.

    #antipattern

    No thanks.

    What if I have a #linux #pinephone or something?

    What if I have a #degoogled phone?

    And the funny thing is, the app is probably just a wrapped web-page when you actually go download it. Which I won't be doing.

    I'll put in a service request and waist the vendor's time instead. Because I can. This is not good customer service.

    I want to like alchitry.com

  40. Ugh. Reporting another anti-pattern from apple. Here is a screenshot.

    Clicked on an epub file, and macos automatically opened this software. Cannot close it. Obviously you can kill it with some sort of a system monitor, but not through the software's normal UI.

    Then I looked at the settings. This software sends all your data to apple engineers so they can know you better. What a disgrace.

    #macos #apple #antipattern #UsersAreFodder #BadUIX #BadDesign

  41. Ugh. Reporting another anti-pattern from apple. Here is a screenshot.

    Clicked on an epub file, and macos automatically opened this software. Cannot close it. Obviously you can kill it with some sort of a system monitor, but not through the software's normal UI.

    Then I looked at the settings. This software sends all your data to apple engineers so they can know you better. What a disgrace.

    #macos #apple #antipattern #UsersAreFodder #BadUIX #BadDesign

  42. Ugh. Reporting another anti-pattern from apple. Here is a screenshot.

    Clicked on an epub file, and macos automatically opened this software. Cannot close it. Obviously you can kill it with some sort of a system monitor, but not through the software's normal UI.

    Then I looked at the settings. This software sends all your data to apple engineers so they can know you better. What a disgrace.

    #macos #apple #antipattern #UsersAreFodder #BadUIX #BadDesign

  43. On the article referenced in mastodon.design/@julieblanc/11, @julieblanc quoted a #TAG commentary
    "Overall, we think #Masonry, #Grid, and wrapping #Flexbox should be incorporated into a unified set of properties. #Chrome’s [New Masonry Layout] proposal splits apart property sets too eagerly, but even the #WebKit [using CSS Grid] proposal seems to miss a chance to develop more-general properties. (…) #CSS currently has 3 layout modes (…): Grid, Multicol, and wrapping Flexbox. This is already causing a lot of author confusion, and Masonry attempts to add a 4th mode. As a general principle, having vastly different ways to accomplish slightly different things is a usability #antipattern. We urge the [CSS] W[orking] G[group] to explore ways to unify these so that authors can port more knowledge from one to the other (even if they are implemented as separate code paths internally). (Issue #1003 on w3ctag/design-reviews, comment on Nov 20, 2024, by #JeffreyYasskin /@jyasskin)

  44. On the article referenced in mastodon.design/@julieblanc/11, @julieblanc quoted a #TAG commentary
    "Overall, we think #Masonry, #Grid, and wrapping #Flexbox should be incorporated into a unified set of properties. #Chrome’s [New Masonry Layout] proposal splits apart property sets too eagerly, but even the #WebKit [using CSS Grid] proposal seems to miss a chance to develop more-general properties. (…) #CSS currently has 3 layout modes (…): Grid, Multicol, and wrapping Flexbox. This is already causing a lot of author confusion, and Masonry attempts to add a 4th mode. As a general principle, having vastly different ways to accomplish slightly different things is a usability #antipattern. We urge the [CSS] W[orking] G[group] to explore ways to unify these so that authors can port more knowledge from one to the other (even if they are implemented as separate code paths internally). (Issue #1003 on w3ctag/design-reviews, comment on Nov 20, 2024, by #JeffreyYasskin /@jyasskin)

  45. On the article referenced in mastodon.design/@julieblanc/11, @julieblanc quoted a #TAG commentary
    "Overall, we think #Masonry, #Grid, and wrapping #Flexbox should be incorporated into a unified set of properties. #Chrome’s [New Masonry Layout] proposal splits apart property sets too eagerly, but even the #WebKit [using CSS Grid] proposal seems to miss a chance to develop more-general properties. (…) #CSS currently has 3 layout modes (…): Grid, Multicol, and wrapping Flexbox. This is already causing a lot of author confusion, and Masonry attempts to add a 4th mode. As a general principle, having vastly different ways to accomplish slightly different things is a usability #antipattern. We urge the [CSS] W[orking] G[group] to explore ways to unify these so that authors can port more knowledge from one to the other (even if they are implemented as separate code paths internally). (Issue #1003 on w3ctag/design-reviews, comment on Nov 20, 2024, by #JeffreyYasskin /@jyasskin)

  46. This is a common #antipattern that I see with #microservices architecture. If you find yourself needing to implement a distributed two-phase commit over a multiple micro services, then you have most likely made the architecture too fine grained.

    stackoverflow.com/questions/55

    #distributedcomputing #microservices #programming

  47. This is a common #antipattern that I see with #microservices architecture. If you find yourself needing to implement a distributed two-phase commit over a multiple micro services, then you have most likely made the architecture too fine grained.

    stackoverflow.com/questions/55

    #distributedcomputing #microservices #programming

  48. This is a common #antipattern that I see with #microservices architecture. If you find yourself needing to implement a distributed two-phase commit over a multiple micro services, then you have most likely made the architecture too fine grained.

    stackoverflow.com/questions/55

    #distributedcomputing #microservices #programming

  49. This is a common #antipattern that I see with #microservices architecture. If you find yourself needing to implement a distributed two-phase commit over a multiple micro services, then you have most likely made the architecture too fine grained.

    stackoverflow.com/questions/55

    #distributedcomputing #microservices #programming

  50. Can You Loop Inside a Loop?

    A loop in programming is a control structure that repeatedly executes a block of code or low code as long as a specified condition is met. It enables programmers to automate repetitive tasks, iterate over data structures (like collections, arrays, or lists), and efficiently handle scenarios where the same operation needs to be performed multiple times. Using loops, developers can build cleaner, more concise code and reduce redundancy.

    The simplest and most common way of looping in coding is through the use of a for loop. A for loop allows you to execute a block of code a specific number of times by defining an initialization, a condition, and an increment/decrement operation in a single, compact structure. It is widely used in many programming languages due to its clarity and versatility, especially when the number of iterations is known in advance.

    Image source: https://admin.salesforce.com/blog/2022/automate-this-how-to-use-loops-in-flow

    Loops within Loops (Nested Loops)

    Loops within loops, often referred to as nested loops, are not inherently antipatterns, but they can become problematic depending on the context and scale of the data being processed. Nested loops are perfectly valid when dealing with scenarios that naturally require a hierarchy of iterations. However, they can lead to performance issues, especially when both loops iterate over large collections, resulting in increased complexity. This can significantly slow down the execution of code or low code.

    Are Nested Loops an Antipattern?

    When there are more efficient and optimized alternatives available, then nested loops become an antipattern. Additionally, deeply nested loops can reduce code readability and maintainability, making it harder for other developers (or even your future self) to understand and modify the code.

    The key is to assess whether the nested loop is the simplest and most efficient approach for the given problem. If not, it’s worth exploring alternative strategies to improve performance and code quality.

    Loops in Flow

    Loop have limited functionality in flows: You have to loop over a collection, and you can only determine whether you want to loop first to last or the other way around. Salesforce flow lacks all the other sophisticated ways you can loop in code.

    For loop can be achieved in Salesforce flow by leveraging the assignment and decision elements. A loop element cannot be used to create a for loop. To loop 5 times in Salesforce flow you do the following:

    1. Create a counter variable CounterVar.
    2. Increment the counter variable value by one using an assignment element functionality. Configure the assignment element to show CounterVar Add 1.
    3. Add a decision element to check whether the CounterVar equals 5. If not send to flow back to step 2.

    Collections

    In Salesforce Flow, collections are a type of variable that can store multiple values of the same data type, allowing you to manage and process lists or groups of records efficiently within a flow. Collections are particularly useful when you need to handle bulk data operations, such as looping through records, performing actions on multiple items, or passing data between flow elements, flows and code.

    Salesforce flow also lacks the capability of building and processing complex collections compared to the the functionality in code.

    When are Nested Loops Necessary?

    When you are processing related records, nested loops may be necessary. Before you take that route, please consider more efficient alternatives by evaluation the following factors:

    • When modifying multiple records with the same field values, you don’t need to loop and build a collection to be used outside your loop. One single update element with criteria can do this for you. Example: Close all cases matching a specific criteria (e.g. under Account Acme).
    • When checking whether a specific junction object record exits before creating a new one, consider leveraging the collection filter element. This setup seemingly results in a nested loop because the collection filter outputs a collection. However, internal loop iterates at most a single time, and therefore does not present a performance concern.
    • When checking whether a record exists before creating it, consider leveraging the check matching record functionality in the create element. This functionality currently does not work for junction object records, and the matching record criteria builder is limited. Read Create by Checking a Matching Record in Flow to learn more about this functionality.
    • Check whether you can leverage the transform element to save one of the loops in your nested loop setup. Read 6 Things You Can Do With The Transform Element to learn more about this topic.
    • When comparing two collections and finding common and uncommon members, consider invocable Apex actions on UnofficialSF. These actions leverage the enhanced collection functionality in code to bring efficiency to your flow.

    Optimize Collections and Avoid Nested Loop Pitfalls

    In addition, consider using the assignment element for getting count of members in the collection, and the transform element for getting sum of number field values in a collection. While these are not tips related directly to nested loops, they may save you one loop within your nested loop configuration.

    Finally, remember that the get element now supports a maximum number of records to get. This number can be set to any number between 1 and 2,000. Also note that the collection sort will take the same parameter while sorting the records, allowing the collection to be trimmed to a smaller member count.

    If you considered all the alternatives, you can still use nested loops. Avoiding DMLs and SOQLs (Gets) inside your loops, you could avoid most of the governor execution limits. Your biggest risk is going to be hitting the dreaded Apex CPU limit error.

    Conclusion

    When designing Salesforce Flows, it is important to avoid nested loops whenever possible to maintain efficiency and prevent performance issues, especially when dealing with large datasets. Nested loops can significantly increase the number of iterations, leading to potential governor limit exceptions and reduced performance in the Salesforce environment. Instead, consider using collection processing techniques, such as using formulas, assignment elements, or collection filters. Additionally, leverage Apex Actions for complex logic. There are scenarios where nested loops are absolutely necessary, such as when processing multi-level data structures or implementing hierarchical logic. In such cases, it is crucial to minimize the loop size by applying filters beforehand and optimizing the logic within the loop. This ensures the flow remains scalable and maintainable. Ultimately, the key is to strike a balance between avoiding unnecessary complexity and using nested loops judiciously when the business logic demands it.

    Explore related content:

    Salesforce Flow Best Practices

    Can You Use DML or SOQL Inside the Loop?

    How The Transform Element Saves You Loops

    Start Element Formulas

    #Antipattern #ForLoop #Loops #NestedLoops #SaleforceAdmins #Salesforce #SalesforceDevelopers

  51. Can You Loop Inside a Loop?

    A loop in programming is a control structure that repeatedly executes a block of code or low code as long as a specified condition is met. It enables programmers to automate repetitive tasks, iterate over data structures (like collections, arrays, or lists), and efficiently handle scenarios where the same operation needs to be performed multiple times. Using loops, developers can build cleaner, more concise code and reduce redundancy.

    The simplest and most common way of looping in coding is through the use of a for loop. A for loop allows you to execute a block of code a specific number of times by defining an initialization, a condition, and an increment/decrement operation in a single, compact structure. It is widely used in many programming languages due to its clarity and versatility, especially when the number of iterations is known in advance.

    Image source: https://admin.salesforce.com/blog/2022/automate-this-how-to-use-loops-in-flow

    Loops within Loops (Nested Loops)

    Loops within loops, often referred to as nested loops, are not inherently antipatterns, but they can become problematic depending on the context and scale of the data being processed. Nested loops are perfectly valid when dealing with scenarios that naturally require a hierarchy of iterations. However, they can lead to performance issues, especially when both loops iterate over large collections, resulting in increased complexity. This can significantly slow down the execution of code or low code.

    Are Nested Loops an Antipattern?

    When there are more efficient and optimized alternatives available, then nested loops become an antipattern. Additionally, deeply nested loops can reduce code readability and maintainability, making it harder for other developers (or even your future self) to understand and modify the code.

    The key is to assess whether the nested loop is the simplest and most efficient approach for the given problem. If not, it’s worth exploring alternative strategies to improve performance and code quality.

    Loops in Flow

    Loop have limited functionality in flows: You have to loop over a collection, and you can only determine whether you want to loop first to last or the other way around. Salesforce flow lacks all the other sophisticated ways you can loop in code.

    For loop can be achieved in Salesforce flow by leveraging the assignment and decision elements. A loop element cannot be used to create a for loop. To loop 5 times in Salesforce flow you do the following:

    1. Create a counter variable CounterVar.
    2. Increment the counter variable value by one using an assignment element functionality. Configure the assignment element to show CounterVar Add 1.
    3. Add a decision element to check whether the CounterVar equals 5. If not send to flow back to step 2.

    Collections

    In Salesforce Flow, collections are a type of variable that can store multiple values of the same data type, allowing you to manage and process lists or groups of records efficiently within a flow. Collections are particularly useful when you need to handle bulk data operations, such as looping through records, performing actions on multiple items, or passing data between flow elements, flows and code.

    Salesforce flow also lacks the capability of building and processing complex collections compared to the the functionality in code.

    When are Nested Loops Necessary?

    When you are processing related records, nested loops may be necessary. Before you take that route, please consider more efficient alternatives by evaluation the following factors:

    • When modifying multiple records with the same field values, you don’t need to loop and build a collection to be used outside your loop. One single update element with criteria can do this for you. Example: Close all cases matching a specific criteria (e.g. under Account Acme).
    • When checking whether a specific junction object record exits before creating a new one, consider leveraging the collection filter element. This setup seemingly results in a nested loop because the collection filter outputs a collection. However, internal loop iterates at most a single time, and therefore does not present a performance concern.
    • When checking whether a record exists before creating it, consider leveraging the check matching record functionality in the create element. This functionality currently does not work for junction object records, and the matching record criteria builder is limited. Read Create by Checking a Matching Record in Flow to learn more about this functionality.
    • Check whether you can leverage the transform element to save one of the loops in your nested loop setup. Read 6 Things You Can Do With The Transform Element to learn more about this topic.
    • When comparing two collections and finding common and uncommon members, consider invocable Apex actions on UnofficialSF. These actions leverage the enhanced collection functionality in code to bring efficiency to your flow.

    Optimize Collections and Avoid Nested Loop Pitfalls

    In addition, consider using the assignment element for getting count of members in the collection, and the transform element for getting sum of number field values in a collection. While these are not tips related directly to nested loops, they may save you one loop within your nested loop configuration.

    Finally, remember that the get element now supports a maximum number of records to get. This number can be set to any number between 1 and 2,000. Also note that the collection sort will take the same parameter while sorting the records, allowing the collection to be trimmed to a smaller member count.

    If you considered all the alternatives, you can still use nested loops. Avoiding DMLs and SOQLs (Gets) inside your loops, you could avoid most of the governor execution limits. Your biggest risk is going to be hitting the dreaded Apex CPU limit error.

    Conclusion

    When designing Salesforce Flows, it is important to avoid nested loops whenever possible to maintain efficiency and prevent performance issues, especially when dealing with large datasets. Nested loops can significantly increase the number of iterations, leading to potential governor limit exceptions and reduced performance in the Salesforce environment. Instead, consider using collection processing techniques, such as using formulas, assignment elements, or collection filters. Additionally, leverage Apex Actions for complex logic. There are scenarios where nested loops are absolutely necessary, such as when processing multi-level data structures or implementing hierarchical logic. In such cases, it is crucial to minimize the loop size by applying filters beforehand and optimizing the logic within the loop. This ensures the flow remains scalable and maintainable. Ultimately, the key is to strike a balance between avoiding unnecessary complexity and using nested loops judiciously when the business logic demands it.

    Explore related content:

    Salesforce Flow Best Practices

    Can You Use DML or SOQL Inside the Loop?

    How The Transform Element Saves You Loops

    Start Element Formulas

    #Antipattern #ForLoop #Loops #NestedLoops #SaleforceAdmins #Salesforce #SalesforceDevelopers

  52. (and yes, I'm pretty sure I've filed a radar about it) #UX #antipattern

  53. (and yes, I'm pretty sure I've filed a radar about it) #UX #antipattern

  54. (and yes, I'm pretty sure I've filed a radar about it) #UX #antipattern