I am facing an issue with the a!fileUploadField() component in Appian. The validation logic is supposed to restrict uploads to only PDF files, but it is not throwing an error when an XLSX file is uploaded. Below is my implementation:
a!fileUploadField()
a!fileUploadField( label: "File Upload", labelPosition: "ABOVE", target: cons!W500_KnowledgeCenter, maxSelections: 5, value: ri!File, saveInto: ri!File, validations: { if(fv!files.extension="PDF", "Error", "") } )
Discussion posts and replies are publicly visible
Is this a good Code
a!fileUploadField( label: "File Upload", labelPosition: "ABOVE", target: cons!W5000_KnowledgeCenter, maxSelections: 5, value: ri!File, saveInto: ri!File, validations: { a!localVariables( local!err:a!forEach( items: fv!files, expression: if(fv!files.extension[fv!index]="PDF","Error","") ), local!err ) } ) }