I have uploaded multiple images in the document folder in my application using 'Upload File' option in the Action and Image Id of these images is stored in the database table.
Now I want to display these images in the record grid for which I am using the below method in the 'Edit List' feature of the List option of the record:
a!documentImage(
document: fv!row[recordType!Car.modeldetails.Image]
)
Where image is the name of column storing image IDs in the modeldetails database table.
But by executing this I am getting the below text as the result in place of image:
[@attributes=[@anyAttribute=[_cId:7ea9cd6ac69bf45fb67452fc4de3351f], @nil=], document=[Document:405304], caption=, altText=, link=, actions=, backgroundColor=, version=]
Please help me as I want images to be displayed in place of text (image details).
Discussion posts and replies are publicly visible
Hi AyushiAs you can see the definition of the document image, It must be used in a certain field.
So for your case, you can use like belowa!gridColumn( label: "Document Id", value: a!imageField( size:"GALLERY", images: a!documentImage(document: fv!row[recordType!Car.modeldetails.Image])), align: "END" ),
Thank You so much dhananjayk.
The resolution provided by you worked for me.
getting this error, could u guide me why i am getting this,
Interface Definition: Expression evaluation error at function a!gridField [line 2]: A grid component [label="Feedback Details"] has an invalid value for "columns". A grid column [label="File"] has encountered an error. Expression evaluation error at function a!imageField [line 44]: The image at index 1 in an image gallery component [label=""] has an invalid value for "document". "document" must not be null.
You will find plenty solutions here, using the search function.
All you need to do is to add a if() to check whether the document is null. Then either show no image, or a placeholder.