I have a text(ex: "a b cd" or "aa1 b c def") containing feq

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

  • 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.
  • 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
  • 0
    Certified Lead Developer
    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.