Set Variable Task 1.0 and 2.0

View some of the Frequently Asked Questions to our support staff. Included are some tips and tricks making this forum ideal for users getting started with GoAnywhere MFT. Note: Users can reply to existing topics but only our support staff can add new topics to this forum.
1 post Page 1 of 1

Support_Hans

Support Specialist
Posts: 9
Joined: Mon Jul 22, 2019 11:32 am

Post by Support_Hans » Thu Sep 26, 2019 2:21 pm
Question: What makes Set Variable Task 2.0 different from 1.0, and is there a way to change the version within a Project?

Answer:

Set Variable Task 1.0

The set variable task can set a variable's value to static text, to a variable previously defined in another task, to data from the first row of a RowSet, or to the contents of a file.

When setting the value of a variable either a Value or an Input File must be specified.

The Value attribute can accept a combination of static text, string variables, numeric variables, function results, and RowSet column values. When referencing a RowSet, you must specify the column number or name. For example: ${RowSetName[columnNumber]} / ${RowSetName[columnName]}. If the RowSet contains more than one row, all other rows except for the first will be ignored.

The Input File attribute should contain the path and file name of a file on the local system or network share. The contents of the file will be placed into the variable. Since the entire contents of the file is stored in memory it is recommended to only use small file sizes. If a large file is required you should determine whether enough memory has been allocated to GoAnywhere to support it.

Set Variable Task 2.0

The description of version 2.0 is almost identical to version 1.0, with a few minor additions. Version 2.0 adds the ability to set a variable's value to a value from JSON or XML data and when retrieving data from a RowSet, the Set Variable task must be inside a For Each Loop. For example, specifying a value of ${data[1]} inside a loop will set your Variable Name to the value of the current row's first column. In the Advanced Panel, version 2.0 includes a Value Parser, Parse Path, and Base64 Decode fields to accommodate the addition of JSON or XML files. Examples are provided in the GoAnywhere MFT User Guide on how to parse a value from an XML or JSON file.

Convert existing Tasks to Newer or Prior versions

Even though a new version of a Task may be made available by HelpSystems in a product upgrade, existing Projects will continue to use the version of the Task(s) available when those Projects were created. Those Projects will not automatically use the latest versions. This preserves the behavior of existing Projects, which allows you to upgrade GoAnywhere without having to retest all of your Projects.

*NOTE* It is recommended that you make a copy of your Project before changing the Version number for any Tasks in your Project.

Instructions for changing the Set Variable Task version
1. Open the Project in which to change the Task version Number.
2. From the page toolbar, click "Show XML".
3. In the Project XML page, locate the version number for a Task and change it to the desired version. It would look similar to: <setVariable name="testVariable" version="1.0" />
4. When complete, click the Validate and Save button. The changes will be visible in the Project Designer.
1 post Page 1 of 1