Error Evaluating UI Expression

Hello.

I am getting the following error when attempting to import an excel workbook into Appian.

From the Debug screen

Error Evaluating UI Expression
Expression evaluation error [evaluation ID = 168eb:f0c68] in rule 'excel_import' at function a!fileUploadField [line 6]: Error in a!forEach() expression during iteration 1: Expression evaluation error at function a!multipleFileUploadField_getEvalFileName [line 41]: Unexpected number of parameters.

From the Interface screen (FYI... I do not have a Line 41)

Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function a!fileUploadField [line 6]: Error in a!forEach() expression during iteration 1: Expression evaluation error at function a!multipleFileUploadField_getEvalFileName [line 41]: Unexpected number of parameters.

a!formLayout(
label: "Import Excel Details Report",
contents: {
a!sectionLayout(
contents: {
a!fileUploadField(
label: "File Upload",
labelPosition: "ABOVE",
value: ri!ExcelData,
saveInto: ri!ExcelData,
target: cons!Excel_imported_files_pointer,
fileNames: "Excel Data " & now() & " " & user(),
validations: {}
)
}
)
},
buttons: a!buttonLayout(
primaryButtons: {
a!buttonWidget(
label: "Import",
submit: true,
style: "PRIMARY"
)
},
secondaryButtons: {
a!buttonWidget(
label: "Cancel",
value: true,
saveInto: ri!cancel,
submit: true,
style: "NORMAL",
validate: false
)
}
)
)

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    That's a strange error message.  I noticed the issue with "user()" right around the same time I saw stefan's comment beat me to it (drats!) - i think you might be looking for the "loggedinuser()" function, which returns the current viewer's username.

    Further, I believe the "fileNames" parameter requires an array, unless you're limiting the upload field to a single file (which you have not done).  And I would note that you're overwriting the original file's name (which you may intend to do), but also, "now()" will assign some characters (forward slashes, colons, etc) to the filename which will not be compatible with files that you want users to download back to their system (in case that's relevant in this case), so I'd suggest you sanitize that before including it in a filename.

Reply
  • 0
    Certified Lead Developer

    That's a strange error message.  I noticed the issue with "user()" right around the same time I saw stefan's comment beat me to it (drats!) - i think you might be looking for the "loggedinuser()" function, which returns the current viewer's username.

    Further, I believe the "fileNames" parameter requires an array, unless you're limiting the upload field to a single file (which you have not done).  And I would note that you're overwriting the original file's name (which you may intend to do), but also, "now()" will assign some characters (forward slashes, colons, etc) to the filename which will not be compatible with files that you want users to download back to their system (in case that's relevant in this case), so I'd suggest you sanitize that before including it in a filename.

Children
No Data