Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Suggested Answer
+1
person also asked this
people also asked this
Replies
15 replies
Answers
2 answers
Subscribers
8 subscribers
Views
21709 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Expression evaluation error at function 'contains' [line 39]: Invalid types, can only act on data of the same type (Any Type, Text)
eliav
over 7 years ago
Hello All,
I need to read an array extracted by a datasubset just to know if it contains a particular string
Following the code
contains(
index(
local!datasubset.data,
"status",
null
)
,"TO DO")
I have this eror
Expression evaluation error at function 'contains' [line 39]: Invalid types, can only act on data of the same type (Any Type, Text)
How can I do ?
Thanks
Elia
OriginalPostID-253930
Discussion posts and replies are publicly visible
Top Replies
Stefan Helzle
over 7 years ago
+2
suggested
A Score Level 3
You can use the function touniformstring() to convert a list of any data to a list of strings. tostring() concatenates all items to a single string.
PhilB
over 7 years ago
+1
A Score Level 1
Try wrapping the index() function in tostring().
Mike Schmitt
over 7 years ago
+1
suggested
Certified Lead Developer
Be careful - contains() expects its first parameter to be an array, and in this case it's an array of the property "status" from your datasubset. Wrapping this in "tostring()" will cause the whole array…
Parents
+1
Mike Schmitt
Certified Lead Developer
over 7 years ago
Be careful - contains() expects its first parameter to be an array, and in this case it's an array of the property "status" from your datasubset. Wrapping this in "tostring()" will cause the whole array to be converted into one concatenated string, in which case your contains() call will return FALSE in cases where it should return TRUE.
I think the proper rule to use in this case would be 'touniformstring()', which converts an array into an array of strings.
Cancel
Vote Up
+1
Vote Down
Sign in to reply
Verify Answer
Reject Answer
Cancel
0
sergeiz
over 6 years ago
in reply to
Mike Schmitt
Thanks, it's not easy to find this function.
I can use any() but it is ten times slower than contains().
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
sergeiz
over 6 years ago
in reply to
Mike Schmitt
Thanks, it's not easy to find this function.
I can use any() but it is ten times slower than contains().
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data