Using Variables in RubiPython
The variables defined at the workbook/pipeline level can be
used in the RubiPython custom component.
To use a user-defined variable in RubiPython, follow the
steps given below.
- Create
your algorithm flow. Refer to Building Algorithm Flow in a Workbook Canvas.
Drag and drop RubiPython on your workbook
canvas.
If required, connect other nodes to
the RubiPython node in your algorithm flow.
Select RubiPython and in
the Properties pane, click Configure.
The configuration page is displayed.
- For example, if the variable name is var1, you can use
it in RubiPython as : Var1Value = getVariable(@@var1@@).
- To set the variable value to use it further in the flow, use
setVariable function as below:
- To assign or update the var1 variable value as that of the
other variable value var2 where var2 is taken from the rubipython code flow,
use below code using function of setVariable(@@var1@@, var2) as :
- After
execution, the current value of var1 variable is set as 15.
The updated
value of the variable can be referred to in the further tasks.
Related Articles
RubiPython
Writing Custom Code using RubiPython Rubipython Task is available in Pro Code in TaskPane options of Workbook and Pipeline. Below mentioned functionality is available in Workbook as well as Pipeline. To write your custom code using RubiPython, follow ...
RubiPython
Writing Custom Code using RubiPython To write your custom code using RubiPython, follow the steps given below. Create your algorithm flow. Refer to Building Algorithm Flow in a Workbook Canvas. Drag and drop RubiPython on your workbook canvas. Notes: ...
Custom Functions in RubiPython
Reading Data from File A sample Python code to read data from file is shown in the image below. The table below explains the above code snippet. Line of Code Result getReaderData(“datasetName”,“subdatasetName”) This custom function checks the type of ...
Custom Functions in RubiPython
Reading Data from File A sample Python code to read data from file is shown in the image below. The table below explains the above code snippet. Line of Code Result getReaderData(“datasetName”,“subdatasetName”) This custom function checks the type of ...
Usage of Variables
In Rubiscape, you can add a variable at the workbook or workflow level. Refer to Adding a Variable. Rubiscape provides variable support, that is, its usage, for all tasks anywhere in workbooks or workflows like creating a dataset, performing data ...