Well, too bad we're not using Perl, you could just use the split
function to feed the values into an array. But, since we are talking
remedy here, try the following:
Create a tmpChar, tmpChar2 and tmpInt field.
1) Filter sets tmpChar = $112$ and calls a filter guide.
2) guide calls the following: (guide label start before any filters are
added)
a) Filter sets 'tmpChar2' = SUBSTR('tmpChar', 0,
(STRSTR('tmpChar',";")-1))
b) Filter sets 'tmpChar' = SUBSTR('tmpChar',
(STRSTR('tmpChar',";")+1))
c) Filter will take action on tmpChar2, such as doing your push
to the user form to add a group to the user
d) Filter will go to guide label start if 'tmpChar' != $NULL$
AND 'tmpChar' != ";"
So, let's say you have the following:
$112$ = bob;tom;sue;
1) Filter sets tmpChar = "bob;tom;sue;
->> go to guide label start
a) Filter sets 'tmpChar2' = bob
b) Filter sets 'tmpChar' = tom;sue;
c) Filter will take action on tmpChar2, doing a push to user where
'Login Name' = "bob"
d) Since 'tmpChar' = tom;sue; you will go to guide label start
->> go to guide label start
a) Filter sets 'tmpChar2' = tom
b) filter sets 'tmpChar' = sue;
c) perform action on tom
d) go to guide label
->> go to guide label start
a) Filter sets 'tmpChar2' = sue
b) Filter sets 'tmpChar' = $NULL$ (or "")
c) perform action on sue
d) do nothing (exit guide by default) because 'tmpChar' = $NULL$'
I think this should work for you, and it should involve one filter, a
guide, and then a) and b) can both be the same filter, but separate
actions, and then c) and d) will each have to be their own filter, so
you are looking at four filters and a filter guide.
Let me know if this just doesn't quite work.
Thanks,
Gary Opela, Jr.
-----Original Message-----
From: Action Request System discussion list(ARSList)
[mailto:[EMAIL PROTECTED] On Behalf Of Brien Dieterle
Sent: Monday, September 22, 2008 12:51 PM
To: [email protected]
Subject: split a field and loop on each piece
**
Hello list, here's another one for ya.
I'm working with field 112 on a form, that may contain one userID, or it
might contain a bunch (like 'user1'; 'user2'; 'user3'), etc.
I want to loop over all of these records, and then loop on each userID
within field 112 (loop in a loop?) and do something with the UserID (In
this case, add the user to a group)
I've done table looping before, but I have no idea where to begin to
loop over a split field.
First of all, how would I split this field into pieces (individual
userIDs) and then act on each? I've looked through the functions and
nothing seems equivalent to unix's "cut" command for pulling a field
based on a delimiter, nor a way to keep repeating an action until the
field is processed. I am strongly considering just abandoning the Field
112 anyway, and using an entire form just for storing the UserID to
Parent. Then at least I can just loop over that form and forget about
the field splitting...
Thanks for any ideas.
Brien
__Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are"
html___
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are"