question

PrajapatiHrideshLTInfotech-4265 avatar image
0 Votes"
PrajapatiHrideshLTInfotech-4265 asked PrajapatiHrideshLTInfotech-4265 commented

Copy folder with files from Sharepoint to Blob Storage

I want to copy folder along with files from Sharepoint to Blob storage

azure-logic-apps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MayankBargali-MSFT avatar image
0 Votes"
MayankBargali-MSFT answered PrajapatiHrideshLTInfotech-4265 commented

@PrajapatiHrideshLTInfotech-4265 Logic app have Sharepoint connector and Azure blob connector that you can use in your workflow to achive your requirement.
The workflow will be : Logic app trigger --> Get files (properties only) --> loop in through result --> check condition if the item is not folder --> Get file content --> Create Blob v2

For you reference attaching the code view and screeshot of the workflow. You can modify it according to your need.

129746-image.png

Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.


codeview.txt (5.5 KiB)
image.png (53.9 KiB)
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

This solution looks good. As I am new to Logic app I have to learn little bit on it and then implement your solution. Appreciate your effort for providing codeview

0 Votes 0 ·

@MayankBargali-MSFT : Can you also guide me how I can do the recursive call in logic app to check if it folder or file. Using "for each" I can just iterate to single folder level. In my case files can be present at any hierarchical level i.e. Folder1-> Folder2-> Folder3->Folder4 -> xyz.pdf

0 Votes 0 ·
MayankBargali-MSFT avatar image MayankBargali-MSFT PrajapatiHrideshLTInfotech-4265 ·

@PrajapatiHrideshLTInfotech-4265 Get-Files (properties-only) action returns the list of all files/folder in the library and by default it returns the nested files and folder. You only need to loop in through the result list of Get-Files (properties-only) as I have done in my workflow screenshoot and the same you can see in the code view.

1 Vote 1 ·

Solution works good ! Thanks
One issue is since the Sharepoint library has lots of files in it , it return me error as reached max size.
So I applied Filter Query to limit the output of the Get Files (Properties)
Odata Filter Query :

Option 1 : substringof( 'XYZ',FileDirRef) eq -1
Option 2 : indexof(FileDirRef, 'XYZ') gt -1

but both of this option didn't worked.
Can you please guide me to provide any solution how I can apply the filter or else who to limit the output of Get Files (Properties)


0 Votes 0 ·