HI EVERYONE I AM NEW WITH APPIAN ,
I AM LOOKING TO UPLOAD MULTIPLE DOCUMENTS BUT I AM STRUGGLING TO FIND A SOLUTION.
I HAVE A LIST OF DOCUMENTS ITEMS THAT I RECEIVE FROM A QUERY ( BECAUSE I NEED TO DISPLAY ON THE INTERFACE THOSE DOCUMENTS FOR THE USER TO UPLOAD , SOME TIMES THE AMOUNT OF DOCUMENTS TO DISPLAY CAN BE DIFFERENTS BASED ON WHAT THE USER CLICK IN THE INTERFACE).
NOW I LOOP THROUGH THE LIST THAT I HAVE AND CREATE A UPLOAD COMPONENT IN THE DYNAMIC WAY AND DISPLAY ON EACH LABEL OF THE COMPONENTS 'S DATA.
BUT HOW CAN I SAVE EVERY DOCUMENTS IN LOCALVARIABLE ?? tHE THING IS THAT I NEED AFTER THAT TO SAVE THOSE FILES DB , SO I CREATE A RULE INPUT DOCUMENT WITH CDT.
THERE IS A BETTER TO DOING THIS ??
Discussion posts and replies are publicly visible
Hi there,
There are 2 approaches to the problem statement.
Welcome to the Appian community. As in any other online community, writing in UPPER case means shouting. Not sure whether that was your intention.
thank you harshit for your response , can you add the code snippet for better understanding ?
thank you
not it wasnt , i apologize
a!localVariables( local!documentList: {1,2,3,4}, local!documentValues: a!forEach( items: local!documentList, expression: null() ), { a!forEach( items: local!documentList, expression: a!fileUploadField( maxSelections: 1, value: local!documentValues[fv!index], saveInto: local!documentValues[fv!index] ) ), a!buttonLayout( primaryButtons: a!buttonWidget( label: "SUBMIT", saveInto: { a!save( ri!documentValues, local!documentValues ) } ) ) } )
Thank you very much Harshit Bumb ,
i think that i understand what you did , i will to that .... but the thing is that after that , i need to put those document in table in db
how can i add for example thoses documents in an of rule input document ( which is document CDT ) ?
a cdt provides the possibility to make values "multiple"(checkbox after the type)-> the issue might be, as you create the db field already, you need perhaps to alter the table and drop the column and then publish it again. Sometimes there ar just issue if you change conditions of cdt parameters afterwards (which equals db columns)In general try to use more specific names if possible. if you document is a bill then call it like that, if its an application then call it "application".second hint: if you use "multiple" cdt parameter then name it multiple like "documents","dates",.... so everyone else who is reading your code can understand directly that this a multiple parameter
I'm working on something similar and able to achieve it for single upload. I'm stuck with what if each generated file uploads accept multiple files.
a!localVariables( local!documentList: { a!map(id: 1, label: "F1"), a!map(id: 2, label: "F2"), a!map(id: 3, label: "F3"), a!map(id: 4, label: "F4") }, local!documentValues: a!forEach( items: local!documentList, expression: 'recordType!{24213204-5e90-4143-9ed4-22c983c605f9}HSS Document Detail'() ), { a!forEach( items: local!documentList, expression: a!localVariables( local!documentType: fv!item.id, a!fileUploadField( label: fv!item.label, maxSelections: 2, value: index( index( local!documentValues, 'recordType!{24213204-5e90-4143-9ed4-22c983c605f9}HSS Document Detail.fields.{22300559-0983-47ad-b74c-1ad6b023bc38}appianDocumentId', null ), fv!index, null ), saveInto: { a!save( target: local!documentValues[fv!index], value: a!forEach( items: save!value, expression: 'recordType!{24213204-5e90-4143-9ed4-22c983c605f9}HSS Document Detail'( 'recordType!{24213204-5e90-4143-9ed4-22c983c605f9}HSS Document Detail.fields.{22300559-0983-47ad-b74c-1ad6b023bc38}appianDocumentId': fv!item, 'recordType!{24213204-5e90-4143-9ed4-22c983c605f9}HSS Document Detail.fields.{65eadee6-cc6f-4a21-8914-a4e3ecc92aa9}documentType': local!documentType ) ) ) } ) ) ), a!buttonLayout( primaryButtons: a!buttonWidget( label: "SUBMIT", saveInto: { a!save(ri!documents, local!documentValues) } ) ) } )