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

Copy a single row of a Shareponint list with attachment

Dear all,

i have created a flow that copy a single row of a sharepoint list if a specific value is set in a cell. This row have an attachment ( a jpg file) but my flow don't copy it. I have modified my flow as sow in figure. But now the flow copy all the row in the sharepoint list, not only the single row.

parte1.PNG

parte2.PNG

parte3.PNG

i think that the problem is in the first or second "apply to each", can you help me solve the problem?

 

Thanks

Cristian

6 REPLIES 6
Highlighted
Super User III
Super User III

Re: Copy a single row of a Shareponint list with attachment

@Webfire 

Can you confirm my understanding of your requirement?  If I understand you correctly, If an item in list A has a column set to certain value, you want to create an item in list B, copy the data from list A and include the attachments from the item in list A.

One quick question - if the item already exists in list B do you want to create an additional item or simply update it?

 

 

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

Scott
Highlighted
Helper I
Helper I

Re: Copy a single row of a Shareponint list with attachment

@ScottShearer 

"Can you confirm my understanding of your requirement? If I understand you correctly, If an item in list A has a column set to certain value, you want to create an item in list B, copy the data from list A and include the attachments from the item in list A."

 

Yes it's correct.

If the item already exists in list B i prefer update it, not create an additional one

 

Thanks

Cristian

Highlighted
Super User III
Super User III

Re: Copy a single row of a Shareponint list with attachment

@Webfire 

This is more complicated than you might think....

In my example, ListA is a custom list where I added a column called MyText.  ListB is identical to list A except that I added a column called ListAID where I store the ID from the related item in list A.

You'll notice that I delete any attachments to the listB item if it exists because I have no easy way to compare attachments - I just remove all attachments and then add them back.

Post here if you have any questions.

AttCopy1.jpgAttCopy2.jpgAttCopy3.jpgAttCopy4.jpgAttCopy5.jpgAttCopy6.jpg

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

Scott
Highlighted
Helper I
Helper I

Re: Copy a single row of a Shareponint list with attachment

Congratulations for the flow, I would never have made it with my knowledge of Microsoft flow. I am only worried about solving problems, in case the flow fails.

 

It can be simplified by creating a control column (for example "assigned_ID") in the list A. If "assigned_ID" is set to zero the flow creates the element in the list B (with attachment). If it is set to 1 the element has already been copied to the list b. It's possible?

 

I have not given you an information, the elements that populate the list A always have only one attachment that is never modified.

 

I thank you for the work you have done and I apologize for having changed my mind after seeing your flow.

 

Thanks

Cristian

Highlighted
Super User III
Super User III

Re: Copy a single row of a Shareponint list with attachment

@Webfire 

Thanks for the feedback!

You said the following:

"It can be simplified by creating a control column (for example "assigned_ID") in the list A. If "assigned_ID" is set to zero the flow creates the element in the list B (with attachment). If it is set to 1 the element has already been copied to the list b. It's possible?"

 

Technically, you can implement your solution but it doesn't handle situations where the data in List A is updated.  You'll still need to copy the ID column form List A to a a column in List B so that there is a link between the two items in case of an update.

 

 

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

Scott
Highlighted
Helper I
Helper I

Re: Copy a single row of a Shareponint list with attachment

@ScottShearer 

Thanks for the reply.
In this specific case I can not manage updates.
These two lists (in a future will be 4) manage the reports to certain work groups. List A is the parent list. All reports will end there. A person will assign them to the work group (today list B, in the future there will also be lists C, D, E) by selecting the destination from the drop-down menu. This selection triggers the flow that copies the line to the correct list.

 

The "assigned_ID" column is a checkbox, it is set to 1 when the row is copied to the destination list. If the person, by mistake, changes the destination and the assigned_ID is set to one the flow does not copy the row again.

 

I only understand now that it is impossible to manage updates between the elements of 5 lists. I apologize for not having understood it before.

 

Thanks
Cristian

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (5,879)