Hello, I have a form that allows users to upload file attachments alongside some other text info, then another form that allows users view attached file alongside the other information, but i don’t know how to view the attached files saved earlier, i need help please.
I think there is a lot of information missing for anyone to be able to answer this. I know it can be done, because it’s in our community here.
Thanks for the response, let me explain further, I have two pages and one page collects data and stores in a collection, User fill in the form on one page and attach a document in word, excel, ppt etc, then on the other page, the user can search a particular information using the primary key, how do i display the attached document corresponding to that record, i can handle that of text, videos, URL but have issues displaying or downloading attachment
Thanks a lot, worked
If no attachment is found, How do i make the user no there is no attachment for that record?
You can check the field
let file = $w(“#dynamicDataset”).getCurrentItem().file
if(file === undefined) {
$w(“button1”).disable()
$w(“#errText”).show() // say something like no file available)
}
use that in the dataset on ready
Thanks for the response, but the button is in a repeater, how do i refer to the exact button sine the buttons will have different IDs in each container
Ok, so you would need to get the item first
put the below in the page on ready.
$w(“#repeater1”).onItemReady((itemData, $item, index) => {
let document = itemData.columnName
if(document === undefined){
$item(“#button1”).disable(); // disable the download button, or you can use .hide()
$item(" #errText ").show() // say something like no file available
}
})