Latest News

the latest news from our team

Set a Variable from File Content with Load from File

You can load a variable from a value in a file. This method can be helpful if you are unable to use a SQL table lookup to look up a value. The file can hold the value that is output from a batch job, a stored procedure, or any program that can save results to a file.

The file can be a constant name or a variable name. If the file is a variable name, you must create an eFORMz variable that is set to the correct value, as shown in this example. The file name is the order number, which eFORMz can get from a shipping label’s REF field. The file contains the customer number. For example, the file 263549.txt  contains the customer number, 8675309.

  1. Save the text file to the /Minisoft/eFORMz_6 directory.
  2. Start eFORMz and open your project.
  3. Create a variable, OrderNum, to hold the value from the REF field on the shipping label. This value is the order number. You might need to add a Substring function to get only the number.
  4. Create a variable, FileName, to store the name of the file.
  5. Set the variable FileName to the value of OrderNum, and the concatenate .txt to create the file name. Right click FileName > Add Function > Set value. Click Variable, select OrderNum, and click OK. 
  6. Next, right click FileName > Add Function > Concatenate, type .txt in the text field, and click OK.
  7. Create a variable, CustNum, to store the value from the file, which is the customer number.
  8. Right click the variable > Add Advanced Function > Load from File. Click Variable, select FileName, and click OK.
  9. The CustNum variable receives the value from the file.

Leave a Reply

Your email address will not be published. Required fields are marked *