Hi,
I have a grid style interface based on process backed record. One of the column(Documents) has multiple files. See the screenshot below:
I'm trying to display download link for the docs listed. I am getting error "Could not display interface. Please check definition and inputs.Interface Definition: Expression evaluation error at function a!forEach [line 358]: Error in a!forEach() expression during iteration 1: Expression evaluation error at function 'document' [line 361]: The passed parameter(s) are of the wrong type. Received the type List of Document."
Here is the code:
a!gridTextColumn( label: "Documents", field: "documentAttachmentArray", data: if(local!datasubset.totalCount=0,{},a!forEach(items: local!datasubset.data, expression: joinarray(index(fv!item, "documentAttachmentArray", {}),"; "))), links: a!forEach( items: local!datasubset.data, expression: joinarray(a!documentDownloadLink( label: document(index(fv!item, "documentAttachmentArray", {}),"name"), document: index(fv!item, "documentAttachmentArray", {}) ),"; ") ) )
Any help is appreciated.
Thanks,
Meena
Discussion posts and replies are publicly visible
I meant to mention about those earlier - they need to be updated such that they can be run with a single null value and return null instead of breaking. In our revised code we are (as required) running each rule on one document at a time, passing in either the document id or null(), not an array. (I believe once passed into the rule, this is cast to an array of 1, either {doc ID} or {null()})
This modification to getDocNames seems to prevent it breaking when passing in {null()} as the rule input:
if( or( isnull( ri!docList ), length( ri!docList ) = 0 ), null, a!forEach( items: ri!docList, expression: document( fv!item, "name" ) ) )
My bad...it works now. Appreciate your timely help. Thanks a lot!
Great, thanks for confirming - I appreciate you already upvoting my relevant answers. In addition, if you happen to see the option to click "verify" on any of those, that might help too.