Make a List of All Related Rows

Hi All,

Just looking for a method to construct a list of all rows related to a particular row so that I can operate on all those rows at once. In this case I want to check them off as complete using a single button press. My relations are nested though, so as an example of a potential structure:

Task A

is related to

Task B, Task C, Task D

which are all related to

Task E

Which is related to

Task F

etc…

It’s easy to do a formula to find Tasks B → D with a formula like this:

ForEach(list(thisRow.Related To),ModifyRows(CurrentValue,Complete,true))

But just struggling on how to make it find Task E, F, and whatever else might be in the chain of relations. The way I can think of is do a recursive ForEach(List), but struggling to think of a way to make that bulletproof so that it will search each row to whatever depth is required to construct a full list. I feel like there must be a more elegant way I’m missing to do this type of recursive search?

Could anyone help me out? Thanks!

Hello!
Maybe this will help?
It catches all the tasks downstream in the chain :grinning_face:

ListCombine(
  thisRow.[Direct Relations],
  thisRow.[Direct Relations].[Downstream Tasks]
)
  .Unique()
  .Filter(
    CurrentValue.IsNotBlank() AND CurrentValue != thisRow
  )

@Larissa_Harada This works perfectly! Thanks so much for your help!