Skip to main content
Participating Frequently
Nov 23, 2021 12:47 AM UTC
Solved

Tried to add a document image for a billboard

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

acaciob0002
Participating Frequently
Nov 23, 2021 2:53 AM UTC

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
Participating Frequently
Nov 23, 2021 2:53 AM UTC

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.

Participating Frequently
Jan 5, 2022 6:37 AM UTC

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

selvakumark
Participating Frequently
Nov 23, 2021 2:59 AM UTC

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.

Participating Frequently
Jan 5, 2022 6:38 AM UTC

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