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
1619 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
Parents
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
Reply
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
Children
No Data