cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper II
Helper II

Filtering & Copying parent/child information within a collection

Hello

 

I have a collection which is basically a copy of a 4 selected columns of a SP list. The collection contains a column with steps and another column with a table with the predecessors of that step. Now what I would like to do is populate the successor field based on the information already here. 

 

Screenshot 2020-10-23 at 18.04.45.png

Screenshot 2020-10-23 at 18.04.30.png



 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

F.ex. Under successor on row 1 it should say Step 2, Step 3, Step 4 as these as these are the direct successors of step 1. 

 

I have been trying something like this, but i have not even been close. And I am not sure this is the best way to do it either. 


ForAll(MyCollection;
If(MyCollection.Predecessor exactin MyCollection.Title; Collect(MyCollection;{Successor:Title})));;

Any help or guidance would be greatly appreciated. 

4 REPLIES 4
Community Support
Community Support

Hi @ToFj ,

Do you want to create a new column named successor with all the  predecessors values?

If so, try this formula:

AddColumns(MyCollection,"Successor",Concat(Predecessor,Value&","))

Then  successor field will with all the predecessors values.

If you want to create a table only with nested values in predecessors field, try this formula:

Clear(Successorcollection);
ForAll(MyCollection,Collect(Successorcollection,{Title:Predecessor.Value}))

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you for the reply @v-yutliu-msft 

Sorry for the poor explanation, i found it a bit hard putting it into words. 

 

What I would like to do is to create a new collection or column in the same collection (Doesn't matter) with the successors of each step in correct relation to the steps. It would have to populate this Successor column based on the information in the steps column (single line of text) and the predecessor column (multiple value lookup column). 

F.ex. It should check the row "step 2", see that step 1 is a predecessor, then collect "step 2" and put that into the successor column for "step 1". This column would then also need to multiple values. 

Hi @ToFj ,

Do you want to add a column with next steps based on Title field?

If so, you could try this formula:

AddColumns(
          GroupBy(
                 AddColumns(
                            MyCollection,"Predecessorvalue",Predecessor.Value
                            ),
                 "Title","Successortable"
                  ),
          "Successor",
          Concat(Successortable,Predecessorvalue&" ")
           )

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-yutliu-msft, sorry for the delayed reply. 

No, I don't think that is exactly what I am looking for. 

 

What I would like to do is to take the step column and enter that into a new column called successors based on the information in the predecessor column. 

 

Ex.
Read row 1: Step 1, Predecessors "empty"  --> nothing

Read row 2: Step 2, Predecessors " Step 1" --> add step 2 to the successor column for row 1. 
.... 

Read row 5: Step 5, Predecessors  " Step  2, Step 3, Step 4" add step 5 to the successor column for row 2, row 3 and row 4. 

 

And if it is easier to create a new collection with the successor steps that doesn't matter. As long as the connection to the step column is correct. These to I can probably patch together when i fill it back into Sharepoint. 

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (48,726)