Hello123
Novice

Download all documents from a ListView that has a SharePoint Content smart object as a data source.

Jump to solution

Hi All,

 

I am stuck at the moment with a requirement at a client. They are using the SharePoint content service to access document libraries to store and retrieve documents.

This current requirement is to retrieve a list of documents, display it in a listview and then to have a button on the listview that will download all the documents displayed.

 

I have yet to find a way to do this as the SmartObject doesnt  allow you to specifically download files as a batch.

 

Can anyone please shed some light on this ?

 

Kind regards,

 

Helgard Wagener

0 Kudos
Reply
6 Replies
K2Ian
Apprentice

Re: Download all documents from a ListView that has a SharePoint Content smart object as a data source.

Jump to solution

Helgard


 


Out of the box, there is no method for downloading multiple files at the same time from a SmartForm. If you are looking to implement this functionality, you will likely have to implement a custom control. It would likely have to iterate through the documents on the list and add them to a single download. This will more than likely cause a significant hit to performance, as it would require having the control download all the documents in the users place so that the user can download them all at once.


 


Ian

0 Kudos
Reply
ajo
Apprentice

Re: Download all documents from a ListView that has a SharePoint Content smart object as a data source.

Jump to solution

Hello,

I have played around with the for loops in 4.6.10 and found a way to download the files in a list view with a button click. I have the assumption that everything displayed on the list view has been filtered as per your requirements. Also, I have only tested this on Chrome and Firefox. 

1. I have a list view which displays the files I would need to download. I used the OOB smartobject to store the files

2. I added three additional controls aside from the list:
- Data Label: where we will inject the script
- File attachment control: where the files on the list view will be loaded one at a time
- Button: on click will download all files listed

3.  When the button is clicked, add the condition: For each item in a List View. Configure it for ALL rows

4. Then on the smartobject tied to the list, add the action to execute the Load method
3297i2F4ACF4E10E3C0C7.png

<script>
$('label[for="00000000-0000-0000-0000-000000000000_6d56b5e1-a015-79aa-90f1-a9f43d7416fc_file-inputId"]').click()
</script>

The label ID is from here:
3299i8524F569C9A6D6C3.png

Hope this helps.

 

Reply
Prajwal_Shambhu
Apprentice

Re: Download all documents from a ListView that has a SharePoint Content smart object as a data source.

Jump to solution
Hi,

Just to keep performance in mind while using for each loop, please make sure you have got maximum up to 5 document records, if you trying to achieve this requirement in some of the admin forms where you need to download 20 plus documents on single shot it gets your form stuck in not responding state and very poor performance. In such scenarios I would definitely write code gives to assembly and refer it using endpoint assembly broker to build your SmartObject and call it on the form.
0 Kudos
Reply
Hello123
Novice

Re: Download all documents from a ListView that has a SharePoint Content smart object as a data source.

Jump to solution

Hi Ajo,

 

This is exactly what I was looking for, I got it working on the second time around. Thank you very much, a well deserved Kudos.

 

Kind regards,

 

Helgard Wagener

0 Kudos
Reply
dgilmour
Apprentice

Re: Download all documents from a ListView that has a SharePoint Content smart object as a data source.

Jump to solution

Worked nicely for me too.

0 Kudos
Reply
dgilmour
Apprentice

Re: Download all documents from a ListView that has a SharePoint Content smart object as a data source.

Jump to solution

Just ran into a snag.. This works great with Chrome, but Internet Explorer will only download one file. Any one else have issues with Internet Explorer?

0 Kudos
Reply