B2Win Suite Documentation (Under Construction)
ContactB2Data
5.2
5.2
  • 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
    • Data Types and Data Structures
      • Primitive Data Types
      • Data Structures
      • SuiteTable
      • Row, Column, StringColumn
    • Non-static Classes
      • Instant Class
      • LocalDateTime
      • LocalDate
      • LocalTime
      • JsonNode Class
      • File Class
    • Static Classes
      • Duration Class
      • Math Class
      • StrictMath Class
      • InstantUtil
      • NumericUtil
      • GeneralDateUtil
      • LocalDateTimeUtil
      • LocalDateUtil
      • LocalTimeUtil
      • DbUtil
      • StateUtil
      • FileUtil
      • JsonUtil
      • HttpUtil
      • NodeInputReader
      • RandomUtil
    • Property Class
    • Context and System
      • Context Class
      • System Class
    • Logging and Configuration
      • Logging
      • Configuration
    • Tutorial
    • Feedback
Powered by GitBook
On this page

Was this helpful?

  1. Scripting
  2. Scripting in B2Data
  3. Custom Script Nodes

Condition Node

In Functions

PreviousIf-Else ConditionNextIn DataPrep

Was this helpful?

Apply conditions and filters to your workflow.

In case you need one or more paths in the workflow to work on special conditions, you can drag the condition node and then write a condition script that returns true or false. When the condition value is true, then the condition node passes the input it received to the next node connected to it. If the condition value is false, then the condition node will not pass the input and next nodes in the current path will not be executed.

In the condition script, you can use the node input value which could be file or data.

  • Use ctrl+space for autocomplete

  • Type util to get all function groups, pick one and then type a dot to view all functions within the group you selected. All Utility Classes are available at .

  • Use NodeInputReader to get the nodes input object.

For example, you might use it to filter data to include only rows where the "Quantity" is greater than 10:

// Read input data and store it as a DataFrame named 'table'
var table = NodeInputReader.inputAsDataFrame();
table.column(1).get(0)
// Check if the value in the 1st row and 2nd column of the DataFrame (USD) is greater than 3.7
if (table.column(1).get(0) > 3.6) {
    // Return true if the condition is met
    return true;
} else {
    // Return false if the condition is not met
    return false;
}
Utility Classes