If elements are present, there is a quick check to make sure that the requested index is within the number of elements in the collection. If the Flow determines that there are no elements present it proceeds to the next collection. The collection that the Flow starts with is arbitrary – mine just happens to start with the Text collection. The first thing it does is count the number of elements in one of the input collections. Other than counters the Flow also will need an input variable to receive the requested index, output variables for each collection type and variables to use in your Loop elements. You could add all sorts of collections to your Flow including collections of SObjects, like Accounts and Contacts. Since mine, so far, handles only two types of collections I have two input collection variables. In order for this Flow to handle different types of collections (Text, Number, SObject, etc) it must have input collection variables for each type. I really only need it to handle Text collections right now, but for the exercise of figuring out how to make it work I included handling Number collections. So far this Flow handles two types of collections: Text collections (elements are outlined in green) and Number collections. Instead of having a Flow that only works on Id (Text) collections (and is named in such a way that I may not think to use it in other situations), why not have one that will work on all sorts of collections? My solution ended up being a combination of three Flows, with the third one returning the Id at a specified index from a collection of Ids.Īs I was putting the finishing touches on that project it dawned on me that the third flow could be a generic utility Flow that simply returns the nth element of any input collection. All of it – no exceptions” which shot me off on a tangent yesterday to see if I could “bulkify” my Get RecordType Id Flow ( Lookup RecordType Ids in Visual Flow – A “Bulkified” Approach). A few days ago I read in Dan Appleman’s book, Advanced Apex Programming, that “all of your Apex code should be designed to handle bulk operations.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |