How to copy dynamic password in text box from another website

I am new to UI path studio and automating website. I have new user account creation setup automation done. once new user creation done, new user will get email notification with temp password.I am able to fetch the username using type into but password field i need to put temp password which is coming thorugh email notification like this
Username : xyz@test.com
Password : w3=y$*@SqW
I have no idea on how to use temp password and put it in “password” field of my actual website

Hi @Amol_Datar,

Welcome!

You have to

  1. Get the Email
  2. Do a Regex to get the password [you can use: “(?<=Password: )(.*)” in the Matches activity]
  3. Use Type Into on the password field

If you need something more in depth, ask =)

1 Like

Hi @Gabriele_Camilli,

Sorry but did not get your point 2 and 3
Where to put regex, I am using Get Text like this
image
And then closing browser, opening another and put the value as password using type into with variable
image
Let me know how to proceed

@Amol_Datar… you need to extract the Onetime(temporary) password from the email body right?

@Gabriele_Camilli is suggesting you use a regular expression. Which will help you to extract the password from the mail body.

Point 2: Is after getting the email, you have to read the email and fetch the Passwords from email body using Regex : (?<=Password: )(.*). This regex helps you to extract any text which will come after “Password:” string.
To make this work you have to use Get outlook mail message activity and iterate the O/P from the Outlook activity.

  1. To read the email body item.Body.ToLower. Store this value in str_body variable
  2. To extract the password
    System.Text.RegularExpressions.Regex.Matches( str_body,"(?<=Password: )(.*)"). Assign this to some variable which is of type Match Collection. Loop that variable, then you will get the required password. Store the password in a variable.
    Else:
    Use a matches activity with regex. You will get the required o/p

Point 2: Use that variable in the type into activity.

Ask anything you required more!

1 Like

I don’t see perfectly but it seems like you are getting in the variable you read litterally:

“Password: Temporary Password

But you can work on that string too, without getting the entire email text, if you prefer

@Gabriele_Camilli, @ManiPrajwal_K - Let me clarify and provide you more detail

  1. I have user creation process which send notification with username and password, I am able to get the user name clearly.
  2. Problem is password getting created for every new user with temp password and password new everytime, I am using fake smtp to receive email
  3. I need to use temp password and put it in actual application as “password” field
  4. What activities I need to and how to proceed.

Hi @Amol_Datar

The activity should be the following:

  1. When you recive the email, use the activity Get outlook mail message and store the body in a string Variable
  2. Use the regex “(?<=Password: )(.*)” in the Matches activity and store the result
  3. Get the result in a String Variable Password
  4. Use the variable Password in Type Into the password Field

@Gabriele_Camilli

  1. I dont have activity Get outlook mail message as I am using Studio pro community edition
  2. Can I use activity as Get text and how to use regex “(?<=Password: )(.*)” in the Matches activity and store the result also how to Get the result in a String Variable Password

Hi @Amol_Datar,

If you can reliably get the body (or the correct part of the body), you can then use the Regex to clean your string, yes

@Amol_Datar… install UiPath.Mail.Activities. You will able to get outlook activities…

1 Like

@Gabriele_Camilli @ManiPrajwal_K
If I do not want to use Outlook and use Get text only option is it possible to use to read the temp password
Appriciate if you can provide me solution for that like

  1. Which activity to be used alongwith which parameter to be passed
  2. How to set variable
  1. Use the Get Text Activity to get the line with the Password and save it to a string Var1
  2. Use the Match Activity with Pattern:“(?<=Password: )(.*)” and Input: Var1 as an input and save the result in a variable (should be Array) Var2

You will get an IEnumerable with 1 Value

  1. Convert the Var2 first value to String and Assign to Password of Type String
  2. Use Password in Type Into password field

@Gabriele_Camilli

  1. I have this get text with variable - Password
    image
  2. Added Match activity
  3. Not able to get it point 3 - 3. Convert the Var2 first value to String and Assign to Password of Type String

Hi @Amol_Datar,

Easiest solution is to use a ForEach and then Assign ReturnPass=item.Tostring

I am not sure I am following you.
May be working session will really helpful as this is causing my almost 20 cases on blcoked.

@Gabriele_Camilli @ManiPrajwal_K
I am not sure I am following you.
May be working session will really helpful as this is causing my almost 20 cases on blcoked.
I am sure there must be someone who can have direct working session to resolve.
Let me know if that can be possible to set it up.

@Amol_Datar… Can you specify where uve been struck… in the process.?

@ManiPrajwal_K @Gabriele_Camilli

  1. I have this get text with variable - Password
    image
  2. Added Match activity


3. Not able to get it point 3 - 3. Convert the Var2 first value to String and Assign to Password of Type String

@Amol_Datar

Have you tried this procedure?

You got a variable named ReturnPass right? It is of type Match collection… Iterate that variable using Foreach loop…
And use the iterable and convert it to string(item.ToString) and assign that variable to your password.

Reply… if you have any hurdles to follow this procedure.

1 Like