Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update getvariable.adoc #3226

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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