How to add variable in config file for outlook mail

Hi Team,

I have a variable called Missingfiles which contains all the missing files name in it.

How can i pass this variable name in config file for email body ?

Hi @Shivam_Rana

  1. In the config file, under the email body column, write a placeholder that will be replaced with the value of the Missingfiles variable. For example, you can use {MissingFiles} as a placeholder.
  2. Read the config file in UiPath using appropriate activities like Read Range (for Excel) or Read CSV (for CSV files) to store the data in a DataTable variable, let’s say configData.
  3. Retrieve the value of the email body from the configData DataTable. You can use a specific row index or a specific column name to access the value. For example, assuming the email body column is named “EmailBody” and it’s in the first row, you can use configData.Rows(0)("EmailBody").ToString() to retrieve the value.
  4. Replace the placeholder {MissingFiles} in the retrieved email body with the value of the Missingfiles variable. You can use the Replace method or the String.Format method for this.

For example:

Dim emailBody As String = configData.Rows(0)(“EmailBody”).ToString()
emailBody = emailBody.Replace(“{MissingFiles}”, Missingfiles)


1 Like

Thanks it worked :v:t2:

Would you please Mark as solution if it’s worked for you.


1 Like

sure will do

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.