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
10 replies
Subscribers
7 subscribers
Views
3859 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
I would like to display some status images in a a!gridImageColumn based on the r
patrickp
over 9 years ago
I would like to display some status images in a a!gridImageColumn based on the result of a condition in a expression rule. The structure is the following:
a!gridImageColumn(
label: "STATUS",
size: "ICON",
field: "travelId",
data: apply(rule!displayStatusImage,local!dataForCurrentPage.travelId))
According to the evaluation, the outputs of rule!displayStatusImage are a!documentImage(document:a!iconIndicator("STATUS_OK")) or
a!documentImage(document:a!iconIndicator("STATUS_NOTDONE") but the error in my SAIL form says:
"A gridImageColumn [label=“STATUS”] has an invalid value for “data.” All elements of “data” must be of the type SafeImage or DocumentImage but were [“Record; Record; Record”]"
I tried to use a!webImage as well but the same error appears.
Thanks in advance!
OriginalPostID-143152
OriginalPostID-143152
Discussion posts and replies are publicly visible
0
Tim
Certified Lead Developer
over 9 years ago
Can you share the code for rule!displayStatusImage?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
patrickp
over 9 years ago
Sure, here the latest attempt:
=if(
rule!TCM_TM_getAppianHeaderRequestByTravelId(ri!travelId_txt).status=cons!TCM_TM_CWTSTATUS_SENT,
a!documentImage(document:a!iconIndicator("STATUS_OK")),
a!documentImage(document:a!iconIndicator("STATUS_NOTDONE"))
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
Hi patrickp, It would be woth checking if you are able to get the data for local!dataForCurrentPage.travelId. As local!dataForCurrentPage is a datasubset variable, I suspect that it would be local!dataForCurrentPage.data.travelId.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
patrickp
over 9 years ago
Hi sikhivahans, yes, I checked and local!dataForCurrentPage.travelId contains the values that I need.
In fact the error says that the system retrieves 3 elements ([“Record; Record; Record”]) which are the elements-rows I want to display.
Unfortunatley if I use local!dataForCurrentPage.data.travelId, I encounter this error:"Interface Definition: Expression evaluation error at function a!formLayout".
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
It would be worth if you can attach the entire code(alteast the piece of code you are using to populate the datasubset and grid) so that some one here might let you know the error immediately.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
patrickp
over 9 years ago
You are right: local!dataForCurrentPage: local!datasubset.data (which contains the result of a query rule).
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
patrickp
over 9 years ago
Of course the error still persists.
In addition, I could say that a part from the gridImageColumn the other gridTextColumns are displayed properly.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
Yep, it would be worth if you could attach the piece of code related to grid and the datasubset population. Also try including a null check in the code of rule!displayStatusImage instead of a direct db query.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
patrickp
over 9 years ago
After the null check, it worked. Thanks for the suggestions!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
Good to hear that. :)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel