B2Win Suite Documentation (Under Construction)
5.4
5.4
  • B2Win Suite Documentation
  • Scripting
    • B2Win Suite Scripting Overview
    • Scripting in B2Data
      • Custom Script Nodes
        • Custom Script
        • Source Script Node (File)
        • Source Script Node (Table)
        • Source Script Node (Object)
        • If-Else Condition
        • Condition Node
      • In DataPrep
      • Properties
      • Workflow Applications
        • Workflow #1
        • Workflow #2
    • Getting Started
    • Language Basics
    • Types & Objects
      • Primitives
      • Objects
        • Instant
        • LocalDateTime
        • LocalDate
        • LocalTime
        • JsonNode
        • ObjectNode
        • File
        • SuiteTable
        • Duration
      • Arrays & Maps
      • Row, Column, StringColumn
    • Utilities
      • Date & Time
        • InstantUtil
        • GeneralDateUtil
        • LocalDateTimeUtil
        • LocalDateUtil
        • LocalTimeUtil
        • Formatting
        • Timezones
      • Math
      • StrictMath
      • NumericUtil
      • DbUtil
      • DbExecutor
      • StateUtil
      • FileUtil
      • JsonUtil
      • HttpUtil
      • NodeInputReader
      • RandomUtil
      • HashingUtil
      • CompressionUtil
      • Logging
    • Properties
    • Context and System
      • Context
      • System
    • Configurations
      • Workflow Configuration
    • Tutorial
    • Feedback
  • B2Data
    • Workflow Settings
      • General Settings
      • Global/All Properties
      • Execution Configuration
        • General
        • Runtime
        • Compiler
        • Storage
        • Clean Up
      • Permissions
    • Nodes
      • Scheduler
    • Services Configuration
      • Power BI
Powered by GitBook
On this page
  • Create a new Workflow
  • Add Nodes to your workflow
  • Edit your Custom-Script Node
  1. Scripting

Tutorial

Write your first script

PreviousWorkflow ConfigurationNextFeedback

Last updated 1 year ago

Create a new Workflow

Create a new workflow in your B2Data environment.

Add Nodes to your workflow

In the left section you can find a list of nodes that you can use to build your workflow. Six of these nodes allow scripting usage which include: Source Script Nodes, Custom Script and Condition.

Edit your Custom-Script Node

Double click on Custom Script node to write a script.

For example, you can write a script to return a filtered table from the table received from previous nodes:

// Get a copy of the table reference from the previous node (premeir league table)
var table = NodeInputReader.inputAsDataFrame();

// Get the 2nd column as a String (football team column)
var stringColumn = table.stringColumn(1);

// Return a new table with only liverpool info filtered
return table.where(stringColumn.endsWith("Liverpool"));

*Feature to write scripts is available in .

Use the functions and classes you learn in to write your own script.

6 nodes
B2Win Suite Scripting
Create New Workflow
Add File Uploader with some file, convert to Excel, then connect node to custom script node