Hi! I have created an app in which the user enters some purchase order fields, and one of them is a PDF file, saving each file that is uploaded in a constant folder of documents. When I end the user task, the document is saved correctly in the folder.
But the fact is that I want that the exact file which the user uploads (related with a Purchase Order ID), to be shown in the summary view for each Purchase Order ID. By now I can upload a the same static PDF for all the summary views, pointing to a constant. But I would want to associate the PDF with its order and show the correct one for each PO. How can I do that?
Thank you so much for your time
Discussion posts and replies are publicly visible
Can you share the code snippet of that fileUploadField?
I typically store the ID of the uploaded file in a field of the record. Then I use that field to show the uploaded field in the record view.
For sure, here you have it:
I have heard of the option you said, but how can I generate a different ID for each PDF and save it into my record field "pedidoPDF"?
Thanks again!
Looks fine from a component perspective. But would help to see the whole form.
You'll need to call a!submitUploadedFiles() in thr saveInto of your submit button if this is not a startForm.
.
I do not understand what you mean with "generate a different ID for each PDF". Appian is doing this for you.
When you upload any file using the fileuploadfield and hit submit, Appian will store the physical file in the folder indicated by the target parameter. The file itself is then referenced by its ID that you can store in an integer field using the saveInto parameter.
Just check out the examples in the documentation.
https://docs.appian.com/suite/help/23.2/File_Upload_Component.html
Thanks for your answers! I did exactly what you said, and now, when I upload a document, an ID is automatically generated in my record.
My question now is, how can I point the document ID in the document viewer component? I know that if I directly put an static document it works. I suppose I have to generate a constant with the list of document IDs, but I´m not sure how. And I cannot reference to records
Thank you so much
I have no idea why you mentions constants all the time .... aaah... it is the placeholder in the input field. Please ignore that.
You store the ID of the document to a field in your record. Then you use that ID to pass it to the document viewer.
I used the ri!record to the record type field with the ID (pedido PDF) and it works properly! Thanks a lot Stefan!