File upload validation

I'm using the following code to validate a user uploaded file : 

 

a!gridRowLayout(
id: ri!index,
contents: {
if(
ri!index > ri!oldAttachments,
a!fileUploadField_17r1(
label: "file upload " & ri!index,
target: ri!target,
value: ri!attachments[ri!index],
saveInto: ri!attachments[ri!index],
validations:{
if(
or(
find("JPG", a!fileUploadField(value: ri!attachments)),
find("JPEG", a!fileUploadField(value: ri!attachments)),
find("PNG", a!fileUploadField(value: ri!attachments)),
find("ICO", a!fileUploadField(value: ri!attachments)),
find("GIF", a!fileUploadField(value: ri!attachments)),
find("BMP", a!fileUploadField(value: ri!attachments))
)>0,"Invalid Format",{}

) } 

 

... 

 

but it gives an error in a!for Each() while uploading another file 

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    A Score Level 1
    in reply to apoorvam
    Will you please tell me which version of Appian you are using. Its differ from version to version. This is not the correct way of using and Appian have not mentioned this approach so they use to change background functionality of components. So if you tell me your Appian Version I can give you proper code for a!fileUploadField_17r1(). In future you may also face same issue if Appian update the back end functionality.
Children