Use Variable Inside .txt File

Hello,

I am trying to send emails that read .txt files for the body of the message.

Within the .txt files, I want to use variables but I’m stumbling here.

Based on a previous post, I’ve tried & and " to separate out the variables, but to no avail.

I have a “Read Text File” with the appropriate filename and assigning it to a String variable.

In the text file, I have the following:

“Hello " & FirstName &”, your order " & orderNumber & " is ready for pickup."

That exact string is what ends up in the body of the email, not the the variables.

Should the “Read Text File” variable not be String?

I appreciate your help.

Brett

Hi @Brett_Johnson

You could pass this string as “HTML template” and you should create those variables in workflow to pass values to them.

In text into txt file you can put FirstName and OrderNumber.

After load txt using read txt file, you can put another assign activity and replace the key words with your variables:

string_variable = string_variable.replace(“Firstname”, variableName).replace(“OrderNumber”, variableOrder)

Then use this variable to send the email.

Let me know if it works for you

1 Like

Brilliant! Thank you so much!

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