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
11 replies
Subscribers
8 subscribers
Views
3732 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
I am running an Quey Rule in a Record to gather data for a grid. It is a simple
lesliem
over 10 years ago
I am running an Quey Rule in a Record to gather data for a grid. It is a simple Query Rule but I am getting the error "Could not display interface. Please check definition and inputs.
Interface Definition: Expression evaluation error : "
Here is the code:
load(
local!pagingInfo:a!pagingInfo(
startIndex: 1,
batchSize: 5
),
local!data: rule!PD_getFeasibilityResponsesByFeasibilityId(ri!selectFeasibilityID),
with(
local!datasubset: todatasubset(local!data,local!pagingInfo),
if(local!datasubset.totalcount<1,
label: "Response for "&index(local!datasubset.feasibilityId,{}),
firstColumnContents: {
a!gridField(
totalCount: local!datasubset.totalCount,
columns: {
a!gridTextColumn(
label: "Assignee",
data: index(local!datasubset.data, "assigneeName",{})
),
a!gridTextColumn(
label: "Response",
...
OriginalPostID-126994
OriginalPostID-126994
Discussion posts and replies are publicly visible
0
lesliem
over 10 years ago
... data: index(local!datasubset.data,"approveDeny",{})
),
a!gridTextColumn(
label: "Comment",
data: index(local!datasubset.data,"comment",{})
)
},
value:local!pagingInfo,
saveInto: local!pagingInfo
)
}
)
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
lesliem
over 10 years ago
I have created the input variable in the Interface, selectFeasibilityID.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
abhi.jana
Appian Employee
over 10 years ago
Hi Leslie,
In line10 of your code [label: "Response for " &index()] - index() takes three arguments but you only specified two. The right syntax would be similar to -
label: "Response for " & index(local!datasubset.data, ri!selectFeasibilityID, {})
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
lesliem
over 10 years ago
I made that change, even took that line out and still have the same error.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
lesliem
over 10 years ago
I removed the if(local!datasubset.totalcount<1, and that seemed to help. I no longer get the Interface Definition: Expression evaluation error but I am now getting "Interface Definition: Expression evaluation error in rule 'pd_getfeasibilityresponsesbyfeasibilityid' (called by rule 'pd_feasibilityresponses') [line 20]: " It is very Query rule is very simple. It looks up the list of records by feasibilityId. feasibilityId is a Numeric(Integer) field. There are records in the table.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
abhi.jana
Appian Employee
over 10 years ago
I don't see the rule 'pd_feasibilityresponses' in your previous code. Could you please paste that part of the code?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
lesliem
over 10 years ago
Here is the PD_feasibilityResponses code:
load(
local!data: rule!PD_getFeasibilityResponsesByFeasibilityId(ri!selectFeasibilityID),
local!pagingInfo:a!pagingInfo(
startIndex: 1,
batchSize: 5
),
with(
local!datasubset: todatasubset(local!data,local!pagingInfo),
label: "Response for " & index(local!datasubset.data,ri!selectFeasibilityID,{}),
a!sectionLayout(
firstColumnContents: {
a!gridField(
totalCount: local!datasubset.totalCount,
columns: {
a!gridTextColumn(
label: "Assignee",
data: index(local!datasubset.data, "assigneeName",{})
),
a!gridTextColumn(
label: "Response",
data: index(local!datasubset.data,"approveDeny",{})
),
a!gridTextColumn(
label: "Comment",
data: index(local!datasubset.data,"comment",{})
)
},
value:local!pagingInfo,
saveInto: local!pagingInfo
)
}
)
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
abhi.jana
Appian Employee
over 10 years ago
Thanks Leslie. Have you tested the PD_getFeasibilityResponsesByFeasibilityId rule in the expression editor? I used a similar rule with your code above and found no errors.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
lesliem
over 10 years ago
That was a great suggestion, so I did just test it in the expression editor and it does work. It pulls back the expected records from the table.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
abhi.jana
Appian Employee
over 10 years ago
Interesting. Here's a few other tests that you might try -
1. Use a different query rule in place of PD_getFeasibilityResponsesByFeasibilityId (Sometimes the interface designer needs a refresh so you might try opening a new designer window and pasting your code)
2. Check the application server log located in <APPIAN HOME>/log for any errors.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>