Skip to main content
Skip table of contents

SetVarFromTextFile: Assign the text content of a file to a variable.

File encoding is automatically detected among the following:

  • UTF8 with BOM

  • UTF8

  • UTF16 LE with BOM

  • UTF16 BE with BOM

  • ASCII/ANSI (default)

Tag Attributes

Attribute Name

Attribute Value

Name

Any unreserved name. Reserved name are listed on: Variables Required

FilePath

Input file path.

Verbose

When set to TRUE, displays a console trace for each element added to the list

Defaults to TRUE

Example script

XML
<ytriaAutomation Application="sapio365">
    <SetVarFromTextFile name="MyVarFromFileUTF8" filepath="C:\utf8.txt"/>
    <Echo value="{%MyVarFromFileUTF8%}"/>
    <SetVarFromTextFile name="MyVarFromFileUTF16" filepath="C:\utf16.txt"/>
    <Echo value="{%MyVarFromFileUTF16%}"/>
</ytriaAutomation>

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.