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

Merge SharePoint lists in collection

Hi all,

 

I have two list which contains data with different records but both have same unique Id in common. I want to merge both with some conditions.

 

1st list records as below: 

 

f_Idapproval_Statusdate
RT-001Approved1/21/2021
RT-002Approved1/27/2021
RT-003Approved1/27/2021
RT-004In Progress1/28/2021

 

2nd list records as below:

 

f_Iditem_Idreturn_statusdescriptiondate
RT-001IT-001Yes.....10/20/2021
RT-001IT-002No.....10/22/2021
RT-002IT-003Yes.....10/25/2021
RT-003IT-004No......10/25/2021

 

So, here between these two lists,  f_Id is unique in both lists.

 I need to do the following which I am stuck on:

 

1- From list 2, I need to filter only those items that has return status No

2- Next, filter only approved records from list 1 and merge them both with same unique Id i.e f_Id.

 

Something like this:

 

f_Iditem_Idreturn_status
RT-001IT-002No
RT-003IT-004No

 

Need your kind help.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Jackson_Dhorty ,

This would be easier if your matching columns did not have the same name

Filter(
   AddColumns(
      RenameColums(
         List2,
         "f_id",
         "fid"
      ),
      "ApprovalStatus",
      LookUp(
         List1,
         f_id = fid
      ).approval_status
   ),
   ApprovalStatus = "Approved" && return_status = "No"
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @Jackson_Dhorty ,

This would be easier if your matching columns did not have the same name

Filter(
   AddColumns(
      RenameColums(
         List2,
         "f_id",
         "fid"
      ),
      "ApprovalStatus",
      LookUp(
         List1,
         f_id = fid
      ).approval_status
   ),
   ApprovalStatus = "Approved" && return_status = "No"
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

WarrenBelz
Super User
Super User

Hi @Jackson_Dhorty ,m

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Thanks @WarrenBelz, your are awesome. It solved my problem.

 

Thanks gain.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,227)