Skip to main content
June 24, 2022
Question

Invalid Content ID error

  • June 24, 2022
  • 5 replies
  • 1 view

// 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,
{}
)
)

5 replies

stefanhelzle0001
Brainy
June 24, 2022

You are aware that the document can only be accessed AFTER a submit? Passing ri!starDoc to your validation expression will not work.

stefanhelzle0001
Brainy
June 24, 2022

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.

June 24, 2022

I have used process start form for uploading files Stefan