Heisenware Docs
Go to websiteGet a demo
  • 👋Welcome
  • Getting started
  • Release Notes
    • v84 - Get in the flow
    • v83 - Beauty treatment
    • v82 — Fully distributed
    • v81 — Removing old cruft
    • v80 — Chicks on fire
    • v79 — Nothing is forever
    • v78 — Keep moving
    • v77 — More intelligence
    • v76 — Well cooked
  • Build & Deploy Apps
    • Overview
    • Flow Builder
      • Nodes (Functions)
        • Inputs
        • Trigger
        • Output
      • Flows
      • Function Extensions
        • Modifier
        • Filter
        • Error handler
        • Memorizer
      • Objects & Instances
      • Utilities
        • Basic Functions
        • PDF functions
        • Circular buffer
        • Timer
        • Counter
    • Integrations
      • Protocol Connectors
        • GraphQL
        • HTTP/REST
        • MQTT
        • OPC UA
          • Heidenhain PLCs with OPC UA
        • RS-232/485
        • Siemens S7
      • Data Connectors
        • File
        • Relational Database
        • Time Series Database (WIP)
      • API Connectors
        • OGC SensorThings API
        • Operating System
        • Zebra RFID IoT Connector
      • Agent / (Edge Connector)
      • Calling Custom Code
    • UI Builder
      • Input Widgets
        • Form
        • File Upload
        • Photo
        • Signature
        • Barcode / QR-Code (WIP)
        • Document Scan (WIP)
      • Display Widgets
        • Chart
        • Chat
        • Circular Gauge
        • Data Grid
        • Linear Gauge
        • Map
        • Media View
        • Progress Bar
        • Sparkline
        • Status Lamp
        • Toast
        • Value Box
        • Kanban Board
        • Data Tiles
        • Pie Chart
        • Sankey
      • Buttons
      • Text Box
      • Images
      • Icons
    • Communication Interfaces
      • Email Notifications
      • OPC UA Server
    • Data & File Storage
      • Internal InfluxDB
      • Internal PostgreSQL
      • File Server
    • App Appearance
      • Pages
      • In-App Navigation
      • Screens & Devices
      • Theming
    • Simulation & Testing
      • Simulating Events
      • Simulating Data
    • PDF Templates
    • RAG-based Chatbot
    • Deployment
  • Manage Apps
    • Overview
    • Manage Apps
      • General Settings
      • Users and Access
      • Distribution & Versioning
    • Manage Integrations
    • Manage Account
      • Account Structure
      • Members
      • Workspaces
  • TUTORIALS
    • Build Your First Heisenware App
  • Connect Heidenhain CNC with OPC UA Support
  • Related links
    • Website
    • Privacy policy
    • Imprint
Powered by GitBook
On this page
  • How it works
  • Configuration
  1. Build & Deploy Apps
  2. Flow Builder
  3. Function Extensions

Filter

Last updated 6 months ago

The filter acts as a guard, allowing the processing flow under specific conditions and blocking it under others. It enables you to halt further data processing if a certain condition is unmet, or continue processing in a specific direction when the condition is satisfied.

Filters are akin to if...else and switch statements in traditional programming.

Filters fall under the category of . The addition or removal of filters follows the same procedure as with other extensions. Click on the + icon situated behind an output, modifier, or error handler, and choose the Filter option.

How it works

When a filter's calculation yields a true result, data processing proceeds beyond the filter. Conversely, if the filter produces a false result, data processing is halted. To configure the filter with expressions leading to true or false results, JavaScript operators and expressions, similar to the , can be employed.

Understanding if a value is or is crucial. In Heisenware, we align with JavaScript's behavior, where certain values are interpreted as true or false. Falsy values, which produce a false inside the filter, include:

  • false

  • undefined

  • null

  • 0

  • ""

  • document.all

All values not listed as falsy are considered truthy. This includes all objects, such as functions and arrays, which are inherently truthy. JavaScript adheres strictly to these rules, where objects without properties or arrays with a length of 0 are still considered truthy. Notably, an empty string ("") and null are falsy, while a space (" ") and the string "null" are truthy.

Configuration

As previously mentioned, a filter can be configured using JavaScript operators and expressions, with the variable x representing the previous value. To explore available operators, refer to the JavaScript documentation and navigate to the sections on and .

In the example below, four filters are attached to a function generating random integers. With the value 10, two filters evaluate to true, and two to false. Only the true filters, the first and the third, allow the subsequent modifier to process the data and calculate a new value.

truthy
falsy
comparison operators
logical operators
modifier
A function with four filters.
function extensions