Using Variables in RubiPython

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.
  1. Create your algorithm flow. Refer to Building Algorithm Flow in a Workbook Canvas.
  2. Drag and drop RubiPython on your workbook canvas.

  3. If required, connect other nodes to the RubiPython node in your algorithm flow.

  4. Select RubiPython and in the Properties pane, click Configure.

  5. The configuration page is displayed.


Write the code in the RubiPython Code Editor. Refer to Writing Custom Code using RubiPython.

 


  1. For example, if the variable name is var1, you can use it in RubiPython as : Var1Value = getVariable(@@var1@@).
  2. To set the variable value to use it further in the flow, use setVariable function as below:
  3. 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 :



  1. 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 ...