0

Working on a flow in which I need to iterate over up to 12 records and sort it in descending order by date. Then take a single value from each record and store it. I will then update the parent record with that value in it's corresponding field.

Ex. First record in the collection take the value from the Qty field and assign it as 1 Month Ago Qty, next record in the collection take the value from the Qty field and assign it as 2 Months Ago Qty, etc. and continue for all records in the collection (max is 12). After the last record, update the parent record with the values in their corresponding fields.

This is what I have so far, I have 12 separate variables, one within each decision node, storing that month's qty and the update record at the end uses all of variables.

Just wondering if there's any ways to clean this up a bit or any best practices i'm missing. Thanks!

enter image description here

1
  • you could move the decision block and 12 paths into a subflow so it was out-of-sight
    – cropredy
    Oct 31, 2023 at 23:38

1 Answer 1

0

With code, you'd use a map. We don't have those in Flows, so this is probably the best you can do without using a lot of extra resources, like SOQL calls, and without writing code.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .