Home

Copy attachment of a list to library

%3CLINGO-SUB%20id%3D%22lingo-sub-1263446%22%20slang%3D%22fr-FR%22%3ECopy%20attachment%20of%20a%20list%20to%20library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1263446%22%20slang%3D%22fr-FR%22%3E%3CP%3EHi%3C%2FP%3E%3CP%3EI%20have%20a%20list%20of%20over%20300%20items%20and%20I%20would%20like%20to%20transform%20it%20into%20a%20library%20or%20at%20least%20switch%20the%20attachments.%20How%20can%20I%20do%20it%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThans%20for%20your%20help%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1263446%22%20slang%3D%22fr-FR%22%3E%3CLINGO-LABEL%3ESharePoint%20online%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Server%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1263776%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%20attachment%20of%20a%20list%20to%20library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1263776%22%20slang%3D%22en-US%22%3EHi%2C%3CBR%20%2F%3EI%20presume%20that%20you're%20looking%20for%20SharePoint%20Online%20-%26gt%3B%20You%20could%20utilize%20Power%20Automate%20to%20create%20a%20Flow%20which%20uses%20the%20%22Manually%20trigger%20a%20Flow%22%20trigger%20and%20add%20%22Get%20Items%22%20action%20of%20SharePoint%20connector%20and%20using%20%22Create%20File%22%20of%20SharePoint%20connector%2C%20you%20can%20copy%20the%20attachments%20from%20a%20SharePoint%20list%20to%20library.%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F376465%22%20target%3D%22_blank%22%3E%40Ben423%3C%2FA%3E.%3CBR%20%2F%3EThanks.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1263925%22%20slang%3D%22fr-FR%22%3ERe%3A%20Copy%20attachment%20of%20a%20list%20to%20library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1263925%22%20slang%3D%22fr-FR%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F114813%22%20target%3D%22_blank%22%3E%40Swaminathan%20Sriram%2C%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20tried%20with%20Power%20Automate%20but%20I%20cannot%20recover%20the%20content%20of%20the%20file.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1264145%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%20attachment%20of%20a%20list%20to%20library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1264145%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F376465%22%20target%3D%22_blank%22%3E%40Ben423%3C%2FA%3E%26nbsp%3B%20hopefully%20this%20will%20help.%20In%20this%20example%20we%20will%20copy%20the%20bell-pepper3.jpg%20attachment%20from%20a%20list%20to%20the%20Documents%20Library.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%220-SP-listAttachment.png%22%20style%3D%22width%3A%20371px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F180472i4C2BE1E93339466A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%220-SP-listAttachment.png%22%20alt%3D%220-SP-listAttachment.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20started%20with%20a%20manual%20trigger%20but%20you%20could%20use%20a%20recurrence%20schedule%20if%20you%20wanted%20it%20to%20copy%20items%20every%20day%20for%20example.%20The%20first%20action%20is%20a%20SharePoint%20%3CEM%3EGet%20items%3C%2FEM%3E%20to%20get%20all%20the%20items%20from%20the%20list.%20Next%2C%20add%20an%20%3CEM%3EApply%20to%20each%3C%2FEM%3E%20control%20and%20select%20%3CSTRONG%3Evalue%3C%2FSTRONG%3E%20from%20the%20dynamic%20content%20box.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%221-trigger-getItems-A2E.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F180473i57DA633832612C4A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%221-trigger-getItems-A2E.png%22%20alt%3D%221-trigger-getItems-A2E.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThen%20add%20a%20condition%20of%20%3CSTRONG%3EHas%20attachments%3C%2FSTRONG%3E%20%3CU%3Eis%20equal%20to%3C%2FU%3E%20%3CSTRONG%3Etrue%3C%2FSTRONG%3E.%20Leave%20the%20red%20If%20no%20channel%20empty.%20In%20the%26nbsp%3B%3C%2FP%3E%3CP%3Egreen%20If%20Yes%20channel%20add%20a%20SharePoint%20Get%20attachments%20action%2C%20selecting%20ID%20from%20the%20dynamic%20content.%20Next%20add%20a%20SharePoint%20Get%20attachment%20content%20action%2C%20selecting%20%3CSTRONG%3EID%3C%2FSTRONG%3E%20and%20%3CSTRONG%3EIdentifier%3C%2FSTRONG%3E%20from%20the%20dynamic%20content.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%222-condition-getAttachments.png%22%20style%3D%22width%3A%20770px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F180474i66A931C39DE894EA%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222-condition-getAttachments.png%22%20alt%3D%222-condition-getAttachments.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAdd%20a%20SharePoint%20%3CEM%3ECreate%20file%3C%2FEM%3E%20action.%20It%20will%20wrap%20itself%20in%20an%20%3CEM%3EApply%20to%20each%3C%2FEM%3E%20control.%26nbsp%3B%20Make%20sure%20for%20the%20File%20Name%20field%20that%20you%20select%26nbsp%3B%3CSTRONG%3EDisplayNam%3C%2FSTRONG%3Ee%20from%20the%20%3CEM%3EGet%20attachments%3C%2FEM%3E%20section%20of%20the%20dynamic%20content.%20For%20the%20File%20Content%20field%20select%20%3CSTRONG%3EAttachment%20Content%3C%2FSTRONG%3E%20from%20the%20%3CEM%3EGet%20attachments%3C%2FEM%3E%20section%20of%20the%20dynamic%20content.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%223-compose-createFile.png%22%20style%3D%22width%3A%20553px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F180490i1D6853B7249516E3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%223-compose-createFile.png%22%20alt%3D%223-compose-createFile.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20you%20run%20the%20flow%20each%20attachment%20will%20be%20created%20in%20the%20documents%20library%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%224-SP-Result.png%22%20style%3D%22width%3A%20505px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F180476i85465338CBC1B3BD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%224-SP-Result.png%22%20alt%3D%224-SP-Result.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERob%3CBR%20%2F%3ELos%20Gallardos%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%20color%3D%22%23333399%22%3EMicrosoft%20Power%20Automate%20Community%20Super%20User%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1264318%22%20slang%3D%22fr-FR%22%3ERe%3A%20Copy%20attachment%20of%20a%20list%20to%20library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1264318%22%20slang%3D%22fr-FR%22%3E%3CP%3EThanks%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F174092%22%20target%3D%22_blank%22%3E%40Rob%20Elliott%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20did%20as%20requested%20but%20I%20have%20the%20impression%20that%20it%20cannot%20find%20the%20attachments%20saved%20in%20the%20list...%3C%2FP%3E%3CP%3EThe%20flow%20does%20not%20indicate%20an%20error.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1264329%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%20attachment%20of%20a%20list%20to%20library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1264329%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F376465%22%20target%3D%22_blank%22%3E%40Ben423%3C%2FA%3E%26nbsp%3B%20can%20you%20post%26nbsp%3B%20screenshots%20of%20your%20flow%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERob%3CBR%20%2F%3ELos%20Gallardos%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%20color%3D%22%23333399%22%3EMicrosoft%20Power%20Automate%20Community%20Super%20User%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1264392%22%20slang%3D%22fr-FR%22%3ERe%3A%20Copy%20attachment%20of%20a%20list%20to%20library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1264392%22%20slang%3D%22fr-FR%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F174092%22%20target%3D%22_blank%22%3E%40Rob%20Elliott%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20screenshots%2C%3C%2FP%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Capture%201.JPG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F180506i54CB5D0A8EAAE8B8%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Capture%201.JPG%22%20alt%3D%221.JPG%20Capture%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Capture%202.JPG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F180504iFC0205DC8A04EAB6%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Capture%202.JPG%22%20alt%3D%222.JPG%20Capture%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Capture%203.JPG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F180505i872BD04D6441C70A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Capture%203.JPG%22%20alt%3D%223.JPG%20Capture%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1264412%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%20attachment%20of%20a%20list%20to%20library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1264412%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F376465%22%20target%3D%22_blank%22%3E%40Ben423%3C%2FA%3E%26nbsp%3Byour%20condition%20has%20%3CSTRONG%3EOui%3C%2FSTRONG%3E%20as%20the%20criteria%20which%20I%20think%20is%20incorrect.%20In%20English%20it%20is%20%3CEM%3EHas%20Attachments%3C%2FEM%3E%20%3CU%3Eis%20equal%20to%3C%2FU%3E%20%3CSTRONG%3Etrue%3C%2FSTRONG%3E%20so%20in%20French%20that%20would%20be%20%3CSTRONG%3Evrai.%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'll%20look%20at%20the%20rest%20of%20it%20but%20that%20was%20the%20first%20thing%20I%20saw%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERob%3CBR%20%2F%3ELos%20Gallardos%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%20color%3D%22%23333399%22%3EMicrosoft%20Power%20Automate%20Community%20Super%20User%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1264632%22%20slang%3D%22fr-FR%22%3ERe%3A%20Copy%20attachment%20of%20a%20list%20to%20library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1264632%22%20slang%3D%22fr-FR%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F174092%22%20target%3D%22_blank%22%3EElliott%20%40Rob%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20wrote%20%22True%22%20and%20it's%20the%20same%20thing...%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Hi,

I have a list of over 300 items and I would like to transform it into a library or at least switch the attachments. How can I do it ?

 

Thans for your help

 

8 Replies
Highlighted
Hi,
I presume that you're looking for SharePoint Online -> You could utilize Power Automate to create a Flow which uses the "Manually trigger a Flow" trigger and add "Get Items" action of SharePoint connector and using "Create File" of SharePoint connector, you can copy the attachments from a SharePoint list to library.
@Ben423.
Thanks.
Highlighted

Hi @Swaminathan Sriram,

 

I tried with Power Automate but I cannot recover the contents of the file.

 

Thanks

Highlighted

@Ben423  hopefully this will help. In this example we will copy the bell-pepper3.jpg attachment from a list to the Documents Library.

0-SP-listAttachment.png

 

I've started with a manual trigger but you could use a recurrence schedule if you wanted it to copy items every day for example. The first action is a SharePoint Get items to get all the items from the list. Next, add an Apply to each control and select value from the dynamic content box.

 

1-trigger-getItems-A2E.png

 

Then add a condition of Has attachments is equal to true. Leave the red If no channel empty. In the 

green If Yes channel add a SharePoint Get attachments action, selecting ID from the dynamic content. Next add a SharePoint Get attachment content action, selecting ID and Identifier from the dynamic content.

2-condition-getAttachments.png

 

Add a SharePoint Create file action. It will wrap itself in an Apply to each control.  Make sure for the File Name field that you select DisplayName from the Get attachments section of the dynamic content. For the File Content field select Attachment Content from the Get attachments section of the dynamic content.

 

3-compose-createFile.png

 

When you run the flow each attachment will be created in the documents library:

 

4-SP-Result.png

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

Highlighted

Thanks @Rob Elliott 

 

I did as requested but I have the impression that it cannot find the attachments saved in the list...

The flow does not indicate an error.

 

Thanks

 

 

Highlighted

@Ben423  can you post  screenshots of your flow?

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

Highlighted

Hi @Rob Elliott,

 

Here is screenshots,

 

Capture 1.JPGCapture 2.JPG

Capture 3.JPG

Highlighted

@Ben423 your condition has Oui as the criteria which I think is incorrect. In English it is Has Attachments is equal to true so in French that would be vrai.

 

I'll look at the rest of it but that was the first thing I saw,

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

Highlighted

@Rob Elliott 

 

I wrote "Vrai" and it's the same thing...