Requirement: Sore uploaded docx ids array in DB column and get array to display uploaded list on UI.
1.Upload Multiple doc and get all docs array ids in local or ri variables, how to achieve? <-- 2.Is this correct approach to store multiple docx ids as array in DB column and retrieve from DB
Using Appian documentation i was able to download multiple document from an array of {docid1,docid2,docid3}
3.How to convert? from Appian multi upload stores i.e. {fn!todocument(6645),fn!todocument(7570)} to expected {6645,7570} <-- 4.How to store/retrieve this docid array in DB ? how to design DB with integer array?
5.May be I am wrong in above approach please let me know best approach to achieve above?
Discussion posts and replies are publicly visible
Check out the examples in the link below, particularly Multiple File Upload with Files. Also make sure to read through the Notes section.
docs.appian.com/.../File_Upload_Component.html
Hi,
I used above example but not getting array with Ids - Actually getting [documentid1-documentname1,documentid2-documentname2] format list.
Expected output docIds only- [documentid1,documentid2]
I was able to download multiple file using array DocArr:{docId1,docid2}
a!forEach( items: {6645,7570}, expression: a!linkField( label: "Link", labelPosition: "ABOVE", links: { a!documentDownloadLink( label: document( fv!item, "id" ), document:todocument( fv!item ) )} )
This is the way how Appian displays the data type "Document". Internally this is just an ID. Does this help?
That helps, This ids: {6645,7570} want to store in DB column and retrieve for above example, but appian doesn't do that, it shows only [6645 - file1.jpg,7570-file2.jpg],
How to convert? from [6645 - file1.jpg,7570-file2.jpg] to {6645,7570}
Use the document function: document("id", ri!document)
What do you mean with "allow"? There is not need to convert anything. As long as you use the type "document" in CDTs, Appian just makes it work. In case you want to display the documents in a list, use the document() function to extract the required data.
I am not able to use document(), any example will help me to understand.
The example Carlos Santander gave above is actually backwards. The proper syntax for 'document()' is "document(ri!docId, "property")", where instead of "property" you type the property you want to retrieve - like "id", "name", "extension", etc.
However if you're just after the ID, then there's no need whatsoever to use document() since your document type variables already contain the ID. Sometimes it helps to cast the document-type variable to integer using toInteger(), but it's really not strictly necessary most of the time.
Mike Schmitt said:The example Carlos Santander gave above is actually backwards
Good catch, thanks!