Skip to main content
August 20, 2023
Solved

Interface Definition: Expression evaluation error at function a!imageField [line 58]: The image at index 1 in an image gallery component [label=""] has an invalid value for "document". "document" must not be null.

  • August 20, 2023
  • 2 replies
  • 0 views

a!imageField(
              label: "",
              labelPosition: "ABOVE",
              images: {
                a!documentImage(
                  document: ri!Vehicle['recordType!{691ee044-4a47-4798-bd87-7f96ca362496}AX Vehicle.fields.{6927f3f6-187b-457b-a2b3-ee2ff6970659}vehicleImage']
                )
              },
              size: "MEDIUM",
              isThumbnail: false,
              style: "STANDARD"
            )

I'm building a process model that displays maintenance request. In that I'm trying to add Vehicle details View interface in the column but after doing that I'm getting the above error. How should I fix this ?

Best answer by mathurambm639546

Hello Kishore,

The reason for this issue is as the error message indicates: the 'vehicle image' record field doesn't have any documents (i.e., it holds a null value). To address this, you should incorporate a null check to handle the situation.


a!imageField(
  images: if(
    a!isNullOrEmpty(ri!doc),
    {},
    { a!documentImage(document: ri!doc) }
  )
)


2 replies

August 20, 2023

Hello Kishore,

The reason for this issue is as the error message indicates: the 'vehicle image' record field doesn't have any documents (i.e., it holds a null value). To address this, you should incorporate a null check to handle the situation.


a!imageField(
  images: if(
    a!isNullOrEmpty(ri!doc),
    {},
    { a!documentImage(document: ri!doc) }
  )
)


August 20, 2023

It worked! Thanks