Skip to main content
November 23, 2021
Solved

Tried to add a document image for a billboard

  • November 23, 2021
  • 4 replies
  • 0 views

Hello,

I am trying to simply display a document image as a billboard. I have added the document and created the constant but when I try to call the constant inside the document image I get an error:

Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function a!documentImage [line 3]: Could not cast from DocumentImage to Document. Details: CastInvalidCould not cast from DocumentImage to Document. Details: CastInvalid

here is the code we are using:

{
a!billboardLayout(
backgroundMedia: a!documentImage(
document: a!documentImage( document: cons!G6EGAF_KPMG_HOWYOUGROW1)
),
backgroundColor: "#f0f0f0",
overlay: a!barOverlay(
contents: {}
)
),

the image is a JPG because that is what appian likes. I am out of ideas. Please help

Best answer by acaciob0002

Hi there,

If your constant is already a document constant, you can try the code below (Very small change from your code):

{
  a!billboardLayout(
    backgroundMedia: a!documentImage(document: cons!G6EGAF_KPMG_HOWYOUGROW1),
    backgroundColor: "#f0f0f0",
    overlay: a!barOverlay(contents: {})
  )
}

Regards,

Acacio B.

4 replies

acaciob0002
November 23, 2021

Hi there,

If your constant is already a document constant, you can try the code below (Very small change from your code):

{
  a!billboardLayout(
    backgroundMedia: a!documentImage(document: cons!G6EGAF_KPMG_HOWYOUGROW1),
    backgroundColor: "#f0f0f0",
    overlay: a!barOverlay(contents: {})
  )
}

Regards,

Acacio B.

January 5, 2022

Thank you! I solved the problem back then the same way!

selvakumark
Participating Frequently
November 23, 2021

Hi,

Seems like you've misconfigured the function. You have called a!documentImage inside a!documentImage. That's why Appian has thrown the error. The code provided by Acacio should work.

January 5, 2022

Thank you I solved the problem back then the same way. We didn't win the competition but ddid get a honorable mention.