PICK ONE OR MORE FROM to string

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Stetson
Posts: 54
Joined: Tue Dec 04, 2018 11:00 pm

PICK ONE OR MORE FROM to string

Post by Stetson »

How do I capture the results of PICK ONE OR MORE FROM to a single comma-delimited string? Let's say we're picking 10 state abbreviations out of 50 and want to store the result as "TX,CA,KY,NY,MO,..." etc. I've defined a string to hold the result (LoggedInRegularUser.tmp_States). Immediately following the PICK ONE OR MORE FROM, I'm doing "LoggedInRegularUser.tmp_States = LoggedInRegularUser.tmp_States + States.ID + ',' ". Obviously this is giving me the first selected entry only, followed by a comma. How do I loop through ALL 10 selections? I know they're in context, but what's the syntax to access them individually? Thanks.
PointsWell
Posts: 1457
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: PICK ONE OR MORE FROM to string

Post by PointsWell »

Call a second process with an input of the States BO.

Process 1

Code: Select all

FIND States
Process2
Process 2 Input States

Code: Select all

IF LIRU.States IS UNDEFINED THEN LIRU.States=States.Code ELSE LIRU.States=LIRU.States+','+States.Code
Process 1 finds all the states, process 2 adds each of these one at a time. Will give you an LIRU.States that is 'AL,AK,NY'

Unless you need that state list to be in context for other processes that are unconnected you could use a non persisted BO during the process that requires the list of states. The benefits of this are that the non persisted BO never has to be cleared as it disappears after the end of the process that it is attached to, whereas you will need to reset LIRU every time that you use it.
Stetson
Posts: 54
Joined: Tue Dec 04, 2018 11:00 pm

Re: PICK ONE OR MORE FROM to string

Post by Stetson »

Thanks very much, PointsWell! Greatly appreciated!
Post Reply