Hi All,
I am getting expression error when trying to pass the below rule in the input a user input task. I am passing the correct PV value in every step of my flow. Please suggest if there is anything wrong in this rule. Thanks in advance.
Expression error: An error occurred while evaluating expression: =rule!REGAL_cdt_getDocumentsFromFolder(pv!caseDocFolder) (Expression evaluation error in rule 'REGAL_cdt_getdocumentsfromfolder' at function 'getdocumentinternalidsfromfolder' [line 2]: Null Arguments are Invalid) (Data Inputs)
REGAL_cdt_getdocumentsfromfolder Rule Code:
load( local!documentsFromFolder: getdocumentinternalidsfromfolder( ri!folder, false() ), a!forEach( items: local!documentsFromFolder, expression: cast( 'type!{urn:com:appian:types}REGAL_documents'(), { documentId: tointeger( fv!item ), documentName: document( tointeger( fv!item ), "name" ), createdBy: document( fv!item, "lastUserToModify" ), createDateTime: document( fv!item, "dateCreated" ) } ) ))
Discussion posts and replies are publicly visible
I didn't look at all your code, but in addition to confirming that your ri of folders is not empty/null, did you also confirm that each folder has at least one document? If a folder can be empty, you need to account for that. Just a quick thing to add and check to see if it gets you unblocked.