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
12 replies
Subscribers
7 subscribers
Views
2765 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
how to handle process report when there are no active processes
garym
over 7 years ago
Hi,
We have a process report which is supposed to show us any open tasks for a process model. It works fine when there are tasks for that process model.
However, I noticed it shows the following error when there are no active processes.
Error Evaluating UI Expression
Expression evaluation error in rule 'rct_report_gaalltaskreport' at function 'toUniformstring' parameter 1 [line 16]: Invalid index: Cannot index property 'c15' of type Text into type List of Variant
What would be the best way to handle this so that users don't see the pink error message?
Thanks,
Gary
OriginalPostID-243721
Discussion posts and replies are publicly visible
0
rishub
over 7 years ago
A null check should work for it.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Shashank
over 7 years ago
@garym
Hi
As suggested above please do a null check
I would also like to add that you can check the totalCount and display a section stating that there are no active tasks in case the totalCount is 0 or else you can display the grid containing the tasks
The totalCount can be obtained from the portalDataSubset returned by the a!queryProcessAnalytics() function
Thanks
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Stefan Helzle
A Score Level 3
over 7 years ago
Using the index() function for column data instead of the DOT notation should help. Looks like
index(local!reportData.data, "c15", {})
Then, the number of data items is in line with the totalCount value and the grid shows the emptyGridMessage which you can customize.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
garym
over 7 years ago
@shashankb - Sorry but I'm very new to the task report and just wondering where I should be doing the null check. This task report was created by someone else with report filters. These filters are populated with task report data. I have attached a copy of the task report. I like the suggestion you had with the section stating that there are no active tasks but not sure where to put that in this report.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 7 years ago
In the 'data' part of the gridTextColumn or gridImageColumn
When you are trying to surface the data whatever is present, you may do as follows:
fn!index(local!filteredTaskReport.data,"c5",{})
fn!property(local!filteredTaskReport.data,"c5",{})
fn!if(local!filteredTaskReport.totalCount = 0,{},local!filteredTaskReport.data.c5)
When you are applying the formatting over the resultant data, it might be worth doing in one of the following ways: (So that we don't end up in applying a rule when there aren't any records)
fn!if(local!filteredTaskReport.totalCount = 0,{},fn!apply(rule!RCT_getAcceptedStatusIcon, index(local!filteredTaskReport.data,"c5",{}))
fn!if(local!filteredTaskReport.totalCount = 0,{},fn!apply(rule!RCT_getAcceptedStatusIcon, local!filteredTaskReport.data.c5)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Shashank
over 7 years ago
@garym
HI ,
Please find the updated code attached
I have added a section ,with a condition which appears only when there is no data in the Task Report
I have also added null checks at some places where it is required , so that some looping functions do not break
This report might fail at places where it is definitely expecting data and we need to gracefully handle such situations
Please let me know , in case there are any issues with the code further on
Thanks
Cancel
Vote Up
-1
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Shashank
over 7 years ago
@sikhivahans , Thank you for your inputs
I have updated them in the code snippet , please let me know in case I have missed out anything and please do correct me in case I went wrong anywhere
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
garym
over 7 years ago
@shashankb @sikhivahans - Thank you so much. I really appreciate it. I will give it a try.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Shashank
over 7 years ago
@garym
No worries :) .. Happy to help !!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
garym
over 7 years ago
@shashankb @sikhivahans - By the way, it worked nicely. Just curious, if I cancel a process and it hasn't been archived off yet, does that constitute a totalCount of > 0 still?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>