Skip to content

Commit

Permalink
Merge pull request #3226 from Mattang-Dan/patch-15
Browse files Browse the repository at this point in the history
Update getvariable.adoc
  • Loading branch information
hansva committed Oct 13, 2023
2 parents f4d628b + c3062a0 commit 41c38e1
Showing 1 changed file with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,18 @@ under the License.

The Get Variables transform allows you to get the value of a variable and create field(s) from it or allows you to add values to existing input rows. You could consider it to be a "Set fields” transform. It can retrieve the value of a previous variable and/or retrieves previous rows or you can set static values to a variable or input rows. You only need to use this transform if you need the variable value in a field.


Note that workflow/environment variables are set only once. A pipeline needs to start to get any new variables. A running or sequential or nested (nested pipelines are technically the same pipeline) pipeline can't fetch new variable values. A pipeline is considered started when a pipeline starts for every row in a pipeline executor.

You can always refer to variables/parameters using the syntax: ${myVariable}, for example from a previous pipeline.

You can always refer to variables/parameters using the syntax: ${myVariable}, for example from a previous pipeline.


For example, you can specify: ${openvar}java.io.tmpdir{closevar}/hop/tempfile.txt and it will be expanded to /tmp/hop/tempfile.txt on Unix-like systems.
For example, you can specify: ``${openvar}java.io.tmpdir{closevar}/hop/tempfile.txt`` and it will be expanded to ``/tmp/hop/tempfile.txt`` on Unix-like systems.


You must always specify the data type or you will have errors like the following:
'''
2023/07/21 09:30:23 - REST client.0 - ERROR: Because of an error, this transform can't continue:
2023/07/21 09:30:23 - REST client.0 - TOKEN_URL None : Unknown type 0 specified.
2023/07/21 09:30:23 - REST client.0 - ERROR: org.apache.hop.core.exception.HopValueException:
'''

``2023/07/21 09:30:23 - REST client.0 - ERROR: Because of an error, this transform can't continue:
2023/07/21 09:30:23 - REST client.0 - TOKEN_URL None : Unknown type 0 specified.
2023/07/21 09:30:23 - REST client.0 - ERROR: org.apache.hop.core.exception.HopValueException:``

See also the Set Variables transform.
To convert the Variable into a data type other than String use Select Values - Meta Data tab.
Expand Down

0 comments on commit 41c38e1

Please sign in to comment.