Hi Team,
users: "username1; {username1; username2}" =>type text
how to get the output as 2 items
username1
{username1; username2}
Discussion posts and replies are publicly visible
Please clarify what you mean by "get the output" - what is this referring to? What are you trying to do?
From this text "username1; {username1; username2}", how can we split based on ";"
userList = "username1; {username1; username2}"
finalList(Output):
Purvaja said:this text
Where is "this text" coming from in the first place? It looks like you're handling an Appian array which, when rendered for display, is given with a ";" separator - but to clarify against a common misunderstanding, arrays do NOT actually contain a ";", it's just there for display reasons. However if you're trying to parse an already-flattened string, then it'll take a bit more work.
Is there a way to split the words using functions in Appain?
Yes you can use the split function but not sure if that will help you do what you want to do.
docs.appian.com/.../fnc_text_split.html
split function is not diving desired result
Mike Schmitt and Mathieu Drouin can you suggest any alternative approach?
That's what I said :)
Problem is you have the same delimiter in both places. That's why Mike was asking where this string was coming from because maybe there is a better way to do this.
Purvaja said:can you suggest any alternative approach?
Is this literal string the only thing you will ever need to handle? Or are there potential variations? This is why I was asking what the source for this string is - if we don't know what cases you'll need to handle, it's nearly impossible to give a meaningful solution.
Yes, Mike Schmittand Mathieu Drouin
I have rule inputs that passes the current user list,
eg: username1 or {username1; username2} or combination username1; {username1; username2}
Ideally, is there a way to append a string with ","
Let's say, I have a string of type text string, now if I want to {"txt1","txt2","text3"}. How to do that?
Purvaja said:rule inputs that passes the current user list,
Can you provide some more detail on this? What format(s) are the rule input(s)? In what way is it/they assigned the "current user list"? What are you trying to achieve overall?
To be very clear,
I have a local variable list-> which stores the values of the pickerFieldUsers, it can be single user or multiple user values.
These values are passed to rule to get the desired output like this
{"txt1","txt2","text3"}
Well the thing there is - a!pickerFieldUsers() will store an array of users - there should be no need to ever manually parse it via splitting a semicolon-delineated flat string.