Flows Automate: Bulk backup all sharepoint-list attachments and images to Onedrive folder



 

Add action “get items”. In the parameters , input Site address, List name



Add action For each (or apply to each) with output from “Get items” step: outputs('Get_items')?['body/value']


Add action”get attachments”: In the parameters , input Site address, List name.

In ID field, select “ID” from “Get items” step, the fomular will be automatically generated :items('For_each_1')?['ID']



Add action “apply to each”, in tab parameters, select output from “Get attachments”step: body('Get_attachments_1')



Add action “Get attachment content”:

In the parameters , input Site address, List name.

In ID field, select “ID” from “Get items” step, the fomular will be automatically generated items('For_each_1')?['ID']

In File identifier field, select “ID” from “Get attachments ” step, the fomular will be automatically generated items('Apply_to_each_1')?['Id']



Add action “Create file” . 

In the parameters , select destination onedrive folder

In Filename field: select dynamic content icon, input this fomular: concat(items('For_each_1')?['ID'], '_', formatDateTime(utcNow(), 'dd-MM-yyyy'), '_', items('Apply_to_each_1')?['DisplayName'])

This naming convention ensures unique file versioning and data traceability for audit purposes.

In file content field, select “Attachment content” from “Get attachments ” step:body('Get_attachment_content_1')

 



Run the flow and see result:



Nhận xét