Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
5 replies
Subscribers
8 subscribers
Views
2353 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Hello, I'm creating a grid that has a grid image in it.
issamd
over 10 years ago
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
0
Tyler Criste
Appian Employee
over 10 years ago
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
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
Tyler Criste
Appian Employee
over 10 years ago
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
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data