What is the best way to store a property(eg - name) of various users and retrieve corresponding individual value?

Hi Uipathians,

I have the following scenario:

  1. From one website, extract the users’ email Ids who registered today(the user list obviously changes daily)
  2. Extract first user from the above list and extract its creation date from 2nd web site(also extracting it’s email Id(1 or more) - currently storing in a string variable)
  3. For the above user, extract its creation date from a 3rd web site
  4. Compare dates of 2) and 3). If dates match, all cool > End
  5. If dates do not match, I have to send email with the email Ids extracted in 2)
  6. Loop takes to 2) and the process continues

Presently am shooting an email as soon 5) is encountered. Hence, if there is more than 1 user whose data does not match, am sending multiple mails.

Requirement: I want to send one final mail, containing email IDs of ALL the users whose data does not match, in a format like:

User 1’s email ID(s): ab1@yahoo.com, ba1@gmail.com
User 2’s email ID(s): ab2@yahoo.com, ba2@gmail.com
User 3’s email ID(s): ab3@yahoo.com, ba3@gmail.com

This should be done outside the loop used in 6), which right now is being done inside the mail.

Any help leading to the solution is highly appreciated.
Thanks!

PS: I am trying to store the email IDs in a list but not sure how to use it in the format given above

You can use simple string variable for storing all exceptional email ID(s). Instead of sending email ID one by one just assign bodyofEmail = bodyEmail+ currentRow.
And on the end of your processing if (Not string.IsnullOrEmpty(bodyOfEmail)) then send your email which somehow contains your variable bodyOfEmail.

Thanks for responding, @Uemoe!
In- bodyofEmail = bodyEmail+ currentRow - bodyofEmail is variable(a Collection/list?).
I did not understand ‘bodyEmail’ - is it something predefined variable? or if to be defined explicitly - what would it be?

Thanks!

I already mentioned it - it’s string variable. Better to assign it empty string in the beginning.

Cool - get your point, @Uemoe !
How to do this task when I also want to have some text in between the variable values.
Eg:
“Total number of users registered: (variable 1 value)
Following are valid users:
(list value 1)
(list value 2)…”

Thanks for all your help!

We already got list of users. Than use string.Format for combining this list with some email template.