RapidCanvas Docs
  • Welcome
  • GETTING STARTED
    • Quick start guide
    • Introduction to RapidCanvas
    • RapidCanvas Concepts
    • Accessing the platform
  • BASIC
    • Projects
      • Projects Overview
        • Creating a project
        • Reviewing the Projects listing page
        • Duplicating a Project
        • Modifying the project settings
        • Deleting Project(s)
        • Configuring global variables at the project level
        • Working on a project
        • Generating the about content for the project
        • Generating AI snippets for each node on the Canvas
        • Marking & Unmarking a Project as Favorite
      • Canvas overview
        • Shortcut options on canvas
        • Queuing the Recipes
        • Bulk Deletion of Canvas Nodes
        • AI Guide
      • Recipes
        • AI-assisted recipe
        • Rapid model recipe
        • Template recipe
        • Code Recipe
        • RAG Recipes
      • Scheduler overview
        • Creating a scheduler
        • Running the scheduler manually
        • Managing schedulers in a project
        • Viewing the schedulers in a project
        • Viewing the run history of a specific scheduler
        • Publishing the updated data pipeline to selected jobs from canvas
        • Fetching the latest data pipeline to a specific scheduler
        • Comparing the canvas of the scheduler with current canvas of the project
      • Predictions
        • Manual Prediction
        • Prediction Scheduler
      • Segments and Scenarios
      • DataApps
        • Model DataApp
        • Project Canvas Datasets
        • Custom Uploaded Datasets
        • SQL Sources
        • Documents and PDFs
        • Prediction Service
        • Scheduler
        • Import DataApp
    • Connectors
      • Importing dataset(s) from the local system
      • Importing Text Files from the Local System
      • Connectors overview
      • Connect to external connectors
        • Importing data from Google Cloud Storage (GCS)
        • Importing data from Amazon S3
        • Importing data from Azure Blob
        • Importing data from Mongo DB
        • Importing data from Snowflake
        • Importing data from MySQL
        • Importing data from Amazon Redshift
        • Importing data from Fivetran connectors
    • Workspaces
      • User roles and permissions
    • Artifacts & Models
      • Adding Artifacts at the Project Level
      • Adding Models at the Project Level
      • Creating an artifact at the workspace level
      • Managing artifacts at the workspace level
      • Managing Models at the Workspace Level
      • Prediction services
    • Environments Overview
      • Creating an environment
      • Editing the environment details
      • Deleting an environment
      • Monitoring the resource utilization in an environment
  • ADVANCED
    • Starter Guide
      • Quick Start
    • Setup and Installation
      • Installing and setting up the SDK
    • Helper Functions
    • Notebook Guide
      • Introduction
      • Create a template
      • Code Snippets
      • DataApps
      • Prediction Service
      • How to
        • How to Authenticate
        • Create a new project
        • Create a Custom Environment
        • Add a dataset
        • Add a recipe to the dataset
        • Manage cloud connection
        • Code recipes
        • Display a template on the UI
        • Create Global Variables
        • Scheduler
        • Create new scenarios
        • Create Template
        • Use a template in a flow notebook
      • Reference Implementations
        • DataApps
        • Artifacts
        • Connectors
        • Feature Store
        • ML model
        • ML Pipeline
        • Multiple Files
      • Sample Projects
        • Model build and predict
  • Additional Reading
    • Release Notes
      • April 21, 2025
      • April 01, 2025
      • Mar 18, 2025
      • Feb 27, 2025
      • Jan 27, 2025
      • Dec 26, 2024
      • Nov 26, 2024
      • Oct 24, 2024
      • Sep 11, 2024
        • Aug 08, 2024
      • Aug 29, 2024
      • July 18, 2024
      • July 03, 2024
      • June 19, 2024
      • May 30, 2024
      • May 15, 2024
      • April 17, 2024
      • Mar 28, 2024
      • Mar 20, 2024
      • Feb 28, 2024
      • Feb 19, 2024
      • Jan 30, 2024
      • Jan 16, 2024
      • Dec 12, 2023
      • Nov 07, 2023
      • Oct 25, 2023
      • Oct 01, 2024
    • Glossary
Powered by GitBook
On this page
  • Displaying the transformation using DataApp v3
  • Creating an input dataset
  • Creating an input variable
  • Creating an output dataset parameter
  • Creating an output chart
  1. ADVANCED
  2. Notebook Guide
  3. How to

Display a template on the UI

When creating a transform, you can display it on the UI. You can use this to expose parameters inside of the UI so that your transform can be used by non-technical users and work across projects.

Displaying the transformation using DataApp v3

To expose parameters on the UI, you must define each parameter and their properties in the second code block of your transform notebook. Each parameter makes a call to a call or create a function that takes a name which is the name can be used inside the flow file to pass variables into your transformation, metadata which is a dictionary that defines how the parameter will be used and displayed, and a local_context which will always be equal to locals().

Creating an input dataset

To add an input dataset to be used in your transformation, use the get_or_create_input_dataset method. Here is an example:

inputDatasetParameter = Helpers.get_or_create_input_dataset(
  name="inputDataset",
  metadata=Metadata(input_name='Input Dataset', is_required=True, tooltip='Dataset to apply the transformation'),
  local_context=locals()
)

The input dataset can then be used in your transform by using inputDatasetParameter.value.

We recommend getting the input dataset value and assigning it to a variable, like the following:

inDF = Helpers.getEntityData(context, inputDatasetParameter.value)

Required metadata fields: input_name, is_required, tooltip.

Creating an input variable

To add an input variable to be used in your transformation, use the get_or_create_input_var method. Here is an example:

start_dateParameter = Helpers.get_or_create_input_var(
    name="start_date",
    metadata=Metadata(input_name="Start Date", is_required=True, tooltip="Initial date to do the diff", multiple=False, datatypes=['TIMESTAMP'], options=['FIELDS', 'CONSTANT'], dataset=['inputDataset']),
    local_context=locals()
)

Then, the variable can be used in your transform by using start_dateParameter.value.

Required metadata fields: input_name, is_required, tooltip, multiple, datatypes, options.

Creating an output dataset parameter

To give users the ability to define the name of an output dataset, use the get_or_create_output_dataset method. Here is an example:

outputDatasetParameter = Helpers.get_or_create_output_dataset(
  name="outputDataset",
  metadata=Metadata(input_name='Output Dataset', is_required=True, tooltip='Dataset name to be created after the transformation'),
  local_context=locals()
)

The output dataset name given by the user can then be accessed by using outputDatasetParameter.value. Required metadata fields: input_name, is_required, tooltip.

Creating an output chart

To give users the ability to name the output charts, use the get_or_create_output_chart method. Example:

outputChartParameter=Helpers.get_or_create_output_chart(
    name="outputChart",
    metadata=Metadata(input_name='Output Chart Name', is_required=True, tooltip='Name of the output chart'),
    local_context=locals()
)

The name of the output chart given by the user is then accessed inside the transform notebook using outputChartParameter.value.

Required metadata fields: input_name, is_required, tooltip.

| Field            | Description                                                                                                                                                                                                                                                                                                                                                                                                                    |
|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| default_value    | Value that will be used if the user does not enter any input for the parameter.                                                                                                                                                                                                                                                                                                                                                |
| input_name       | Name of the parameter to be displayed on the UI                                                                                                                                                                                                                                                                                                                                                                                |
| datatypes        | List that limits the datatypes accepted by the parameter to any of STRING LONG DOUBLE BOOLEAN TIMESTAMP or ALL                                                                                                                                                                                                                                                                                                                 |
| options          | List that defines what the data input options are. They can be ‘FIELDS’ or ‘CONSTANT’ or both. Fields allows a user to select a column/field from the dataset defined by the datasets . If you choose FIELDS for options, you must define the datasets from which the user can select the columns. If CONSTANT is used, you can add a list of the possible options that users can choose from by defining the constant_options |
| constant_options | List of options that you want presented to the user. See options above                                                                                                                                                                                                                                                                                                                                                         |
| datasets         | List of datasets that will be used to populate field/column options. See options above                                                                                                                                                                                                                                                                                                                                         |
| tooltip          | Description of the input parameter. This will be displayed to the user when they click on a “?” icon. Here is where you should clearly and concisely describe the parameter and how it will be used. It is best to keep it to a sentence or two.                                                                                                                                                                            |
| is_required      | Boolean value that defines whether or not the value is needed for your transformation                                                                                                                                                                                                                                                                                                                                          |
| multiple         | Boolean value that defines whether or not a user can select multiple values for the input parameter.                                                                                                                                                                                                                                                                                                                           |
PreviousCode recipesNextCreate Global Variables

Last updated 1 month ago