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
3 replies
Subscribers
7 subscribers
Views
1617 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
I have a text(ex: "a b cd" or "aa1 b c def") containing feq
ambrishs
over 11 years ago
I have a text(ex: "a b cd" or "aa1 b c def") containing feq chars/word and spaces. I want to get the substring after last space(in this case: cd or def), without using split function. Since it is going to be part of a doForEach i will not be able to use split function.
Thanks in advance....
OriginalPostID-62321
OriginalPostID-62321
Discussion posts and replies are publicly visible
0
abiramej
over 11 years ago
doForEach can be used to process rules that have split function. For your use case, you can use the below expression rules -
A rule to get the last part after the space in your text -
rule!getLastPart
- index(split(ri!textValue,char(32)),length(split(ri!textValue,char(32))),"")
Here, rule input textValue is a single value Text input
You can now run doforeach on the above -
doforeach("rule!getLastPart", ri!arrayOfValues)
Here, arrayOfValues is the array of items that contains many such text as in your example.For each of the text elements, the rule will be executed.
If you are on version lower than 6.7, you can use doforeach. For 6.7 and above, you can use apply() instead as it is an out of the box function.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
ambrishs
over 11 years ago
Thanks.
I want to avoid split, because i am using getprocessnotes(processInstanceId) to get list of Notes(out of box) added on tasks. Now this list has three columns, one being user/author. User/Author need to be substituted with User/Author Full Name.
Now when take the output of getprocessnotes(pId) in an array and pass it in a rule applying doForEach and user your rule it works, but if i pass getprocessnotes(pId) directly as array and apply doForEach it fails on split. Thats the reason i am trying to avoid split. Version used is 6.6.0
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Siva
Certified Lead Developer
over 11 years ago
I suppose this post is related to the post in
forum.appian.com/.../e-62374
I have posted a response there. Let us know if you need more information.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel