Write to Text File that includes variables

Hi there,

I am trying to write information into a text file, but I want this text file to include values that were assigned to 2 variables (ItemNumber and ItemQuantity). I have the Input Text configured in the following way:

“Order Number: ItemNumber
Quantity: ItemQuantity
Order List: FAST-Haz Ship Inventory”

I also tried putting the variables into single quotations to no avail. Any help would be greatly appreciated.

Hi @mgartner,

You would need to do something like this:
“Order Number: " + ItemNumber +
"Quantity: " + ItemQuantity +
"Order List: FAST-Haz Ship Inventory”

This separates the strings and the variables! Make sure that the variables are of type string (or GenericValue)

Let me know if this works!

Hi there, thank you for your response. When I write it to the text file it works but it looks like the following: 1

Would there be any way to get the text file to look more like this? Or at least have spaces between them?
11

I appreciate the help!

1 Like

You can add Environment.NewLine wherever you want a new line, so in your case:

“Order Number: " + ItemNumber + Environment.NewLine +
"Quantity: " + ItemQuantity + Environment.NewLine +
"Order List: FAST-Haz Ship Inventory”

See if that works :slight_smile:

This worked. Thank you so much for the help!

1 Like

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