I need to display a set of records in a grid. I'm using a!gridField. One of the columns will be a!gridImageColumn and its presenting a bit of a challenge. For this column when the value is true then it should display "STATUS_OK" when false it should be blank. Unfortunately I must return an image. I'm forced to use something like an unobtrusive "REMOVE_DISABLED" icon as a workaround
Even replacing the if statement with something like this fails: a!documentImage(document: a!iconIndicator(icon: "STATUS_OK"), showWhen: fv!item).
Anytime there is no image or showWhen = false, I get the message below. ie. Must be SafeImage or DocumentImage.
An Error Has Occurred Expression evaluation error [evaluation ID = BJKF4MAN] in rule 'mr_tam_sc_newassignmentsearch' (called by rule 'mr_tam_if_assignmentdashboard') at function a!gridField [line 22]: The image at index Include Approvals of an grid [label=“”] has an invalid value for “data”. “data” must be of the type SafeImage or DocumentImage. (APNX-1-4255-002)
This may be as good as it gets but before I give up I thought I'd ask.
Discussion posts and replies are publicly visible
I've created my own transparent icon, uploaded it, and referred to that icon to simulate a blank space in the past.
Have to admit, hadn't thought of that. Certainly will become my workaround if I don't hear anything better. Thanks Josh.
Josh, used this. Works like a charm. Thanks again
The other solution for displaying null/blank in a!gridImageColumn,
Cast the null to document type like below
cast( typeof( a!documentImage(document: a!iconIndicator(icon: "ADD" )) ), null )
Will try this out next time... Thanks
For those that come across this post in the future, this isn't necessary for any grids created 19.2 or later. The updated grid function allows for null values in any cell without creating a dummy image!
strongly agreed - the best fix for this issue in the future would be to take the (smallish) effort required to change-over old grids to new ones.
© 2021 Appian. All rights reserved.