Operations Orchestration Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

Convert comma separated list to new variables

SOLVED
Go to Solution
Trusted Contributor

Convert comma separated list to new variables

I have a comma separated list of values (5) that I want to convert each value to a new variable or be able to pull the values out to use elsewhere.

 

What is the best way to accomplish this?

 

Thanks,

Don

 

4 REPLIES
Trusted Contributor

Re: Convert comma separated list to new variables

This is the list
2012-03-28T11:00:00+00:00,2012-03-31T11:05:00+00:00,Task In Progress,2012-03-28T11:05:00+00:00,2012-03-31T11:00:00+00:00
Valued Contributor

Re: Convert comma separated list to new variables

1. Put them in a list ,retrive back using 'List Item Grabber',which is located in Utility operations.This is best choice.

 

2.Put them in Selection list , u can select any one at runtime.

 

3. Put them in Database  and retrive back using  SQL Query.

Honored Contributor [Founder]

Re: Convert comma separated list to new variables

Hi,

 

For me, if I want to extract the value, I will use result tab, and define new variable using table filter and use comma as my separator and specify the column number X to get the value  I want.

 

Regards,
Mahmoud Ibrahim
http://www.mahmoudthoughts.com
  • Say thanks by clicking the "Kudos! Star" which is on the left.

  • Make it easier for other people to find solutions, by marking my answer with "Accept as Solution" if it solves your issue.
  • Highlighted
    Trusted Contributor

    Re: Convert comma separated list to new variables

    This solution works fine except if he wants to put each into a seperate variable then he needs 5 results and is required to set up the filter on each one.

     

    Two other solutions both involve scriplets. If you don't mind that the variable names would just be incremented then you could use:

     

    arrValues = scriptletInput.split(",");
    for(var i = 0; i < arrValues.length; i++) {
      scriptletContext.put("myVarName" + i, arrValues[i]);
    }

     If you needed to name the variables more appropriately then if you had a header seperated list as well you could add that in very easily.