Button link to multiDocument field in collection

I created a repeater to display the data from a collection of event presentation files. One field contains the event presentation files which are mostly PowerPoint; the field is of type Document. I use the onItemReady() function to populate the repeater when the page loads. One element of the repeater is a button to allow the user to download a desired event presentation file. When each item loads, I assign the link value to the button with the following code:

$item ( “#button1” ). link = itemData . presentationFile

It works just fine.

Now, one of my events has five presentation documents. So, I created a new field of multiDocument type, and added all five document files to that field in the appropriate record in the collection. I confirmed that they are all there, using the following when the page loads:

console . log ( "multiDocuments value is " + itemData . multiDocuments )

which gives the result:

multiDocuments value is wix:document://v1/ugd/4405d1_b9f905e6efab49108f363033fe0e32c5.pptx/AdvantEdge%20Careers,%205-25-22.pptx,wix:document://v1/ugd/4405d1_e91e789501fa4a9faa0ba9fb1d5e7322.doc/Networking%20101,%205-25-2022.doc,wix:document://v1/ugd/4405d1_dcea92fca07840cbae5ee1be5083f6ce.pptx/NYS%20DOL,%205-25-22.pptx,wix:document://v1/ugd/4405d1_31967a41737b4c19adff5f05da58b3ae.pptx/NuCareers%20&%20Lee%20Hecht%20Harrison,%205-25-22.pptx,wix:document://v1/ugd/4405d1_5a11f91bcbf1414da4b030441c32fe92.doc/New%20Horizons%20Background,%205-25-22.doc

My question is: How do I code the button to allow the user to download all of the documents for this event? Using the link property like I did for a single document doesn’t work; nothing happens when I click the button. I have searched for information on how to handle files stored in a multiDocument field type and haven’t found much information.

Thanks,
Richard

1 Like

I have the same issue in trying to link the Multi-Doc column in my dataset to a download button. Some of my entries have 2 to 6 items. I want to comment so I can get notified if this issue can be resolved. I can only think of creating multiple entries for each doc as a solution… which is quite tedious.