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
2412 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Why is it that my rule: rule!esc_get_EI_data_by_date_range(todatetime(ri!st
mikek579
over 9 years ago
Why is it that my rule:
rule!esc_get_EI_data_by_date_range(todatetime(ri!start),todatetime(ri!end),topaginginfo(1,100)) returns 100 rows of data for ri!start=10/01/2014,ri!end=10/31/2014 [ri!start & ri!end are both date types],
And
my input task output rule: rule!esc_get_EI_data_by_date_range(todatetime(ac!startDate),todatetime(ac!endDate),topaginginfo(1,100)) returns nothing for ac!startDate=10/31/2014, ac!endDate=10/31/2014, [ac!startDate & ac!endDate are both date types]?
...
OriginalPostID-125679
OriginalPostID-125679
Discussion posts and replies are publicly visible
0
Aleksi White
Appian Employee
over 9 years ago
In the second example you have both ac!startDate and ac!endDate set to 10/31/2014. Is this intentional? What's happening is that you are calling the todatetime() function for two of the same dates. This is resulting in the start datetime and end datetime both being the exact same value. Since they are the same value, there are no values in between them, thus you aren't getting any data back.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mikek579
over 9 years ago
No, that was a typographocal error. Both examples are using the same dates.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mikek579
over 9 years ago
10/1/2014-10/31/2014 to be exact.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Aleksi White
Appian Employee
over 9 years ago
Try defining your ac! variables as todate("10/01/2014") and todate("10/31/2014")
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mikek579
over 9 years ago
That change made no difference.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Tarun Abraham
Appian Employee
over 9 years ago
Is the saveInto variable used in the output of the expression being used to save any other inputs /outputs ?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mikek579
over 9 years ago
No
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Aleksi White
Appian Employee
over 9 years ago
Please tell me if my assumption is correct:
You currently have a user input task, where the user selects the start date and end date on a form. These dates are saved into ac!startDate and ac!endDate, and the rule esc_get_EI_data_by_date_range is executed with this data in the user input task's data output tab.
Can you try saving the ac! variables into process variables in the output tab instead? Then after that have a script task that executes the rule using those process variables instead.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mikek579
over 9 years ago
Your assumption is correct.
Two great minds, etc. I just tried that, and it didn't work either.
However, when I look at the process variables in the instance, startdate and enddate have correct values.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mikek579
over 9 years ago
Success! I added pagininginfo to limit my results. Then I just added a .data segment to my expression
{rule!esc_get_EI_data_by_date_range(todate(pv!startDate),todate(pv!endDate),topaginginfo(1,1555)).data}
which was not necessary in my stand-alone test, but caused the rule to return data!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel