// Getting below error after uploading input file
//Expression evaluation error [evaluation ID = a2059:3adce] in rule 'cb_headervalidation' (called by rule 'cb_fileupload_ui') : com.appiancorp.suiteapi.content.exceptions.InvalidContentException: Invalid Content ID
a!fileUploadField( label: "Upload Star Details File", labelPosition: "ABOVE", target:cons!CB_UPLOADED_DOC, maxSelections:1, value:ri!starDoc, saveInto: ri!starDoc, required:true(), validations: if( isnull(ri!starDoc), "", { rule!CB_HeaderValidation(document:ri!starDoc, headers:cons!CB_STARDETAILS_HEADERS), { if( fv!files.name = "StarDetails", "", "Incorrect file name, Please upload the StarDetails File" ), if( fv!files.extension = "xlsx", "", "File extension should be .xlsx" ) } } ) ),
Rule Header validation:
a!localVariables( local!columnHeaders: readexcelsheetpaging( excelDocument: ri!document, sheetNumber: 0, pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 1) ) , local!temp: local!columnHeaders.data, local!columnHeaderList: remove( local!temp[1].values, wherecontains( "", touniformstring({ local!temp[1].values }) ) ), local!headerValidation: a!forEach( items: local!columnHeaderList, expression: toboolean(fv!item = ri!headers[fv!index]) ), if( contains(local!headerValidation, false()), "InCorrect Columns Header Sequence/Names, Correct Column Sequence/Names are " & ri!headers, {} ))
Discussion posts and replies are publicly visible
You are aware that the document can only be accessed AFTER a submit? Passing ri!starDoc to your validation expression will not work.
The typical approach is to have the user upload the file, submit the form and then add another User Input Task fully chained. In-between you can do the validation in process and show the result to the user in the second screen.
I have used process start form for uploading files Stefan
Sure. Try to implement the described pattern and you will see it works.
Thanks Stefan