Hello, I'm creating a grid that has a grid image in it.

Hello,

I'm creating a grid that has a grid image in it.

I want the grid image to display a document icon and represent a document, and when clicked the document will be downloaded.

Currently my form breaks because if the document ID in the database is blank it returns an error. For the time being I am passing in a 0, since there will never be a document with an ID of 0, but this will forward the user to a blank page.

Is there a way to make the icon not clickable if there is not document at certain points in the array? I will gladly accept other proposed solutions.

Thanks!

Below is my code:

a!gridImageColumn(
label: "View Application",
field: "FilingDocAppianDocID",
size: "ICON",
data: apply(
a!documentImage(
document: _,
altText: _,
caption:...

OriginalPostID-139005

OriginalPostID-139005

  Discussion posts and replies are publicly visible

Parents
  • You need the link element of a!documentImage to be empty if a a docID is not found, right? In that case, you could use an expression rule to wrap a!documentDownloadLink and only return a link if docID is not nule. Your expression rule would look something like this:

    if(rule!APN_isBlank(ri!docID), {}, a!documentDownloadLink(document: ri!docID, label: {}))

    Then, you would apply over that rule instead of documentDownloadLink. So the last part of your expression (to generate the array of links) would be something like this:

    apply(
    rule!theRuleYouCreated,
    local!datasubset.data.FilingDocAppianDocID
    )
Reply
  • You need the link element of a!documentImage to be empty if a a docID is not found, right? In that case, you could use an expression rule to wrap a!documentDownloadLink and only return a link if docID is not nule. Your expression rule would look something like this:

    if(rule!APN_isBlank(ri!docID), {}, a!documentDownloadLink(document: ri!docID, label: {}))

    Then, you would apply over that rule instead of documentDownloadLink. So the last part of your expression (to generate the array of links) would be something like this:

    apply(
    rule!theRuleYouCreated,
    local!datasubset.data.FilingDocAppianDocID
    )
Children
No Data