cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vffdd
Responsive Resident
Responsive Resident

Comparing Sharepoint Lists and Updating

So I have looked through other queries on this topic but can't find anything similar.  If someone can point me to a post or if not if you can help on how I might approach this situation.

 

2 sharepoint lists

 

ListA   and ListB

 

This is a manually triggered flow (will eventually use the powerapps trigger as it will be done from a button in powerapps but happy to just use manual trigger to get it working)

 

I want to pull in a subset of the items in ListA  into ListB   (subset is items filtered based on choice field in ListA).

 

When pulling in the items I want to compare !  so if the item already exists in ListB I want to overwrite (in case changes were made to the item in ListA) and if the item doesn't exist I want to add it into ListB.     

 

and just to complicate things LOL there will be attachments to the items in ListA that will need to be brought in also !

 

Any help gratefully accepted

 

 

6 REPLIES 6
ScottShearer
Super User III
Super User III

@vffdd 

A few questions:

  • How will you decide what items in List A are of interest to you?
  • When doing the compare, how will you decide if the data already exists?  Is there a key column or does each column need to match exactly?
  • If there are attachments and a record is to be overwritten, do the attachments need to be preserved or do you just want the attachments from the item in List A?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
vffdd
Responsive Resident
Responsive Resident

Hi Scott thanks for your response. 

 

  • How will you decide what items in List A are of interest to you?   - As mentioned above. They will be taken based on the option chosen in a choice field in ListA so a filter query of some kind should be able to distinguish them

  • When doing the compare, how will you decide if the data already exists?  Is there a key column or does each column need to match exactly? - A Key column  the ID column in ListA  is listed in ListB   as ListAID .

  • If there are attachments and a record is to be overwritten, do the attachments need to be preserved or do you just want the attachments from the item in List A? -The attachments can be overwritten as they won't ever be deleted on ListA they will only be added to. So overwriting existing ones  on listB  and adding any new ones will be fine. 

@vffdd 

One more question - if an item already exists in List B, can it be deleted and re-added or does it have to be updated (so you can keep the version history, etc.)?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

@vffdd 

See my Flow below.  If the item exists in List B, I update it, remove existing attachments and add attachments from List A.  My condition checks to see if the item already exists.  Let me know if you have any questions

image.pngimage.pngimage.pngimage.png

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
vffdd
Responsive Resident
Responsive Resident

It really needs to be updated if possible

vffdd
Responsive Resident
Responsive Resident

I will give that a go now and see how it works..many thanks

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Kudoed Authors
Users online (2,472)