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
4 replies
Subscribers
7 subscribers
Views
5871 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Error message: Expression evaluation error at function 'tointeger' param
shaoyongw
over 7 years ago
Error message: Expression evaluation error at function 'tointeger' parameter 1: Cannot sub incompatible operands of type List of Variant and type Date with Timezone.
The expression is like: tointeger(data_array - today())
Any ideas how to deal with it?
OriginalPostID-215030
OriginalPostID-215030
Discussion posts and replies are publicly visible
0
chetany
A Score Level 1
over 7 years ago
What is the datatype of data_array? Are you trying to subtract a date from an array of dates?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sagarl511
A Score Level 2
over 7 years ago
@shaoyongw - This error comes only when data_array is {} as this represents a object with no data type associated with it. You may have to type cast to date and then use it.
For e.g - tointeger(todate({})-today()) will return some result.
and tointeger({}-today()) - gives error as you mentioned.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
marcoc918
A Score Level 1
over 7 years ago
What kind of result do you expect from this rule when data_array is empty? I will probably do a thing like this if (rule!APN_isEmpty(data_array),{},tointeger(data_array-today()))
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 7 years ago
@shaoyongw As explained above by other practitioners, you may need to depend on type casting where you may use Conversion Function todate() or you may also use typeof() in combination with cast() on the data_array.
Just in case, if the data_array is an output of the queryEntity, I would suggest converting the queried data to the desired custom data type as that eliminates the usage of conversion functions on individual columns in the CDT which is not a great idea.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel