Workflow Soluiton

 View Only
  • 1.  How to create variable for each item in a collection

    Posted Apr 02, 2014 12:11 PM

    Here's what I have.

     

    I have an Auto Start From Email.  It takes the body of the email and using a "split text into collect" using the delimiter of "new line".  Now I have a collection containing each line.  How do I create a different variable for each of those?

     

    Example body of email:

    Receiving 
    S123456
    7699 
    BP8YBZ2 
    F7B11549C473C 

     

    I would like to have a 

    variable called Type = "Receiving"

    variable called Store = "S12345

    variable called Phone = "7699"

    variable called  SN = "BP8YBZ2"

    variable called MAC = "F7b11549c473c"

     

    Any help would be appreciated.



  • 2.  RE: How to create variable for each item in a collection
    Best Answer

    Posted Apr 02, 2014 11:15 PM
    Can you change email template sent to you? It would be easier if your email was in a format like: Type:receiving store:##### Etc:value. In this case you could use a 'for each' loop to a regex string component on the key (type:) to then route out to a specific variable definition and place the value in it. If not you will need to loop and count the iterations. You can then assign the row value to a variable based on iteration, bit this is much dirtier and requires the email never has differences in line spacing and such. Clear as mud? I can toss together an example tomorrow if needed. Might write one up for the old downloads anyway.


  • 3.  RE: How to create variable for each item in a collection

    Posted Apr 03, 2014 03:47 PM

    Thanks for the reply.  What I ended up doing was close to what you had suggested.  I used the split text into collection with the delimiter of new line, then Get Item By Index for each line that I needed as a variable.  Both ways I believe would have gotten me to the same place.

    Thanks again.