How to combine data

Hi, I am new to UIpath and try to get used to it by self training. I was already successful to create task but now I struggle. I have scanned a mailbox and filter for all mail having the same subject. Then I extract from all mail the old user ID and the new user ID successful. With this information I create automatically a ticket in another system. So far working well. I have recorded the sequence for the ticket creation with no issue. But, I think this is not very well programmed. When I create the tickets I follow always the same process, means open the webpage, go to the valid request and create a ticket. What I want to do is adding all records (old and new ID belongs always to one record) into a “container” open the ticket system only once, and then use the function “for each” to create all tickets. I hope my request is clearly described.

Just re-frame your code.

  1. Read mailbox, store you mails in a variable
  2. check if count is > 0, yes? login to the application, no?end process
  3. take the mail variable, and for each of the mails in the list,
    …3a. get the old and new user id
    …3b. enter you data in the system and create ticket
  4. Logoff once all data is processed.

Okay, so far so clear. How I make sure that the old and new ID stick together? Where is the relation between User, old and new address. Is UIPath managing this without any extra definition from my side?

Create an array variable rather than having separate ones, say array_var type Array[string]
So your array variable will have 2 values {[0]old_id,[1]new_id}
This you can take all the way to the point where you are inserting into the system and when entering use array_var[0] and array_var[1] to insert them.