There is a smart service in my interface known as document upload . When i am uploading any document , it should be in pdf or word format , basically I need to check that User can only upload a pdf or word document . If the user uploads document of different type it should throw the error .
how to achieve this please explain or give some code snippet if possible .
Thanks in advance !
Discussion posts and replies are publicly visible
you can refer uploaded files using fv!files in validations Use it.
https://docs.appian.com/suite/help/24.1/File_Upload_Component.html#all-files-must-be-pdfs go though this.
Hi, you can use this in validation.
a!localVariables( local!invalidExtensions: difference(upper(fv!files.extension), {"PDF","DOCX"}), if( length(local!invalidExtensions) > 0, "Attachments must be pdf or word files. Remove: " & index(fv!files, "name", wherecontains(local!invalidExtensions, upper(fv!files.extension)), {}), "" ) )