I am trying to delete a folder's all documents, at interface expression mode, how to write the code and how to express the document name at a!deleteDocument(document:??????).
Thanks
Discussion posts and replies are publicly visible
As a!deleteDocument can only delete a single document, you will need to create a process to delete multiple documents.
Documents in Appian are referenced by their ID either in a variable of type Integer or of type Document.
how to get folderId? why each time refresh the interface the folderId return differently?
https://codeblog.jonskeet.uk/2012/11/24/stack-overflow-question-checklist/
I can neither see your screen, nor your code, nor do I know what you want to achieve, what you tried, what failed or anything that enables me to give you an answer.
I tried to explain this to you already a few times. It is that simple: No details -> No answer!
Do you know how to let the folder's existed files already shows up once come to the fileupload interface? The previous problems solved.
like this, it is already appeared if the files exists in the folder once reload the interface, how to make it?
You cannot show existing files in a folder inside a fileUploadField.
But you can add a list following this pattern: docs.appian.com/.../document-list-pattern.html
Do you know where to set in order to let it delete multiple documents at once?
I do not understand your question!
what i create is a file upload interface, when it come in it already shows what and how many documents in that folder,
i want it could be delete with click on that files, if i just click one, then it deleted successfully, if i try to click two or more files, it just delete the first file i choose, the second or above just keep retaining at there.
Do you have a code snippet which shows how you delete the files?
a!localVariables( local!oldfile: a!refreshVariable(folder(31338, "documentChildren")), local!file: a!refreshVariable(folder(31338, "documentChildren")), local!deletefile, local!oldfilelist, local!testfile:rule!testfilecasttype(), { a!fileUploadField( label: "File Upload", labelPosition: "ABOVE", target: cons!fileUploadConstant, maxSelections: 10, value: local!file, saveInto: { a!save( target: local!oldfile, value: folder(31338, "documentChildren") ), /*if(length(local!oldfile)=0,{},a!deleteDocument(document:local!oldfile)), */ a!save(target: local!file, value: save!value), a!save(target:local!oldfilelist,value:a!forEach(items:local!oldfile, expression:tostring(fv!item) /*extract(left(fv!item,20),":","]"),*/ )), a!save( target: local!deletefile, value: a!forEach( items: local!oldfile, expression: if( contains(local!file, fv!item) = true(), {}, fv!item ), ) ), a!save(target:local!testfile.file,value:local!oldfilelist), a!save( target: ri!file.file, value: a!forEach(items: local!file, expression: fv!item, ) ), }, fileNames: { fv!file.name }, validations: {}, uploadMethods: "CHOOSE_FILE" ), a!buttonArrayLayout( buttons: { a!buttonWidget( label: "Submit", style: "PRIMARY", submit: true(), loadingIndicator: true(), saveInto:{ /*if(*/ /*or(*/ /*length(a!flatten(local!deletefile)) = 0,*/ /*len(local!deletefile) = 0*/ /*),*/ /*{},*/ /*a!deleteDocument(document: local!deletefile)*/ /*),*/ /*a!writeToMultipleDataStoreEntities(*/ /*valuesToStore: {*/ /*a!entityData(entity: cons!testfileconstant,data:local!testfile),*/ /*}*/ /*),*/ a!startProcess( processModel: cons!wangtestfileuploadprocessmodel, processParameters: { deletefile:local!deletefile, testfile:local!testfile, } ), } ) }, align: "START" ), a!milestoneField( label:"phase", labelPosition: "ABOVE", steps: cons!wangtestphase, links: {}, active: 2, ) } )