Flow Help
NovacuraRoadmap
6.11
6.11
  • What is Novacura Flow?
  • πŸ““System requirements
  • πŸŽ‰Release notes
  • 🎣Getting started
    • Quick start
    • Develop your first app
  • πŸ”¨Installation and upgrade
    • Installation
    • New installation
    • Upgrade installation
    • Apply service pack
    • Add component
    • Windows authentication
    • Event log
    • FAQ
      • Monitoring
      • Troubleshooting
      • Migration tool
      • IIS user permission
      • Moving SQLite portal database
  • 🧱Security
    • Server
      • Security settings
  • πŸ’‘Development
    • Studio
      • Installation and log in
        • OpenID connect
      • Applications
        • Menu
          • Inbox
        • Workflow
          • Start step
          • User step
            • Header
            • Static text
            • Labeled static text
            • Link
            • External app launcher
            • Image viewer
            • Text input
            • Numeric input
            • Date input
            • Time input
            • Check box input
            • Binary option input
            • List selection input
            • List multi-selection input
            • Menu selection input
            • Image selection input
            • Data grid
            • Calendar
            • List presentation
            • Camera input
            • File gallery
            • GPS location input
            • Signature capture input
            • Item creation sub task
            • Check list sub task
            • Verb sub task
          • Machine step
          • Decision step
          • Assertion step
          • Assignment
          • Table
          • Checkpoint
          • Split
          • Join
          • Script item
          • Log point
          • Annotation
          • End step
          • Included workflow
          • Offline resource
          • Public variables
          • Swimlanes
          • Offline workflow
            • Create an offline workflow
            • Create an offline resource
            • Create an offline seed inbox
            • Create an offline transactions
        • Subscribe
        • Server content
          • Workflow scheduler
          • Generate link
        • Elements
        • Problems
        • Find
        • Metadata panel
        • Version panel
        • Navigation
        • Test bench
        • Application package
          • Get started
      • Environment
        • Users
        • Roles
        • Connectors
        • Properties
        • Languages
        • System events
        • Active directory sync
        • License
        • Devices
        • Branding
        • Reports
      • Monitoring
        • Tasks
        • Applications
        • Help requests
      • Connectors
        • Business systems
          • Database
          • IFS Applications
          • Infor M3
            • M3 Infor API
            • Infor M3 REST
          • Maximo Generic
          • SAP
            • SAP BAPI
              • Basic API
                • BAPI: ZNCFLOW_APPLICATION_COMPONENT
                • BAPI: BAPI_MONITOR_GETLIST
                • BAPI: BAPI_INTERFACE_GETDOCU
                • BAPI: RFC_GET_FUNCTION_INTERFACE
                • BAPI: ZNCFLOW_DDIF_FIELDINFO_GET
          • Oracle Primavera
          • Microsoft Dynamics AX
          • Microsoft Dynamics CRM
          • Microsoft Active Directory
          • Microsoft SharePoint 2013
            • Generic operations
              • Custom list
                • Attachments
                • Create new item
                • Create new item, with field values
                • Delete item
                • Get items by query
                • List all items
                • List fields of items
                • Update item field
              • Document library
                • Check in/out file
                • File management
                • Create sub folder
                • Upload/download
              • Tasks
                • Attachments
                • Predecessors
                • Task information
                • Update task
                • Create new subtask
                • Create new task
              • User operations
                • Group operations
                • Get user by ID
                • Get user by login name
                • List users
        • Communication
          • Email
          • Web page submit
          • FTP
            • Server Operations
            • Directory operations
            • Download Operations
            • File Operations
            • Upload operations
          • SFTP
            • Directory operations
            • Download operations
            • File operations
            • Upload operations
          • Modbus
            • Read operations
            • Write operations
          • External Oauth 2.0 provider
          • Siox
          • REST service
            • REST Project Tool
              • Global output
              • Global parameters
              • Authorization schemes
              • Model transform
              • Enumerations
              • Models
                • Custom model member
              • Operations
                • Parameters
                • Outputs
              • Getting started
          • Web service
            • Example
              • Webservice example: Connector to Microsoft Dynamics AX
        • Printing
          • BarTender 2016
            • Print
            • Manually select
            • Print from BTXML script
            • Print from BTXML script
            • List printers
          • NiceLabel
          • Html to PDF
        • Utility
          • Flow environment
          • Table Operations
          • Custom .NET
          • Google API
          • Generate Xml Data
          • Generate text
          • File System
            • Directory operations
            • File operations
            • Zip operations
      • FlowScript
        • Variables
        • Operators
        • Functions
          • Text functions
          • Number functions
          • Date functions
          • Advanced functions
        • Table
          • Table functions
        • Programs
        • Formats
        • Script examples
        • AD sync scripting
    • Portal 2
      • Getting started
      • General
        • Add pages and portlets
        • Edit pages
        • Navigation
        • Style
        • Settings
          • List of values management
          • Presentation mode
      • Portlets
        • Chart portlets
          • Column chart
          • Line chart
          • Pie chart
        • Data tree
        • Document viewer
        • Filter
        • Html table
        • KPI portlets
          • KPI card
          • Speedometer
        • Record viewer
        • Table
        • Text
        • Common configuration
    • Portal
      • Get started
      • Options
        • Settings
        • List of values management
        • Global variables management
        • Content access management
        • Translations management
        • Import/export
      • Portlets
        • Table
          • Database source
          • Workflow source
        • Record viewer
        • Process overview
        • Iframe
        • Inbox
        • News viewer
        • Document tree
        • Document list
        • Document viewer
        • Generic document viewer
        • Generic document viewer URL
        • Generic document viewer
        • Filter
        • HTML
        • Text
        • Data visualizer card
        • Data visualizer navigator
        • Visual planning
          • Gantt chart
          • Kanban
          • Resource bucket
          • Scheduler
        • Map
      • Portal Push
      • Icons
  • πŸ“±Clients
    • Android legacy client
    • iOS client
    • Windows 10 client
    • Web client
    • Windows CE client
  • ❓FAQ
    • How do i find which version of Flow i am running?
  • πŸ“§Contact
Powered by GitBook
On this page
  • The CASE/WHEN/THEN construct
  • The IN operators
  • Truth of Non-Boolean values
  • The JSON module
  • JSON.Decode(data)
  • JSON.DecodeTable
  • JSON.Encode
  • JSON.EncodeTable

Was this helpful?

  1. Development
  2. Studio
  3. FlowScript
  4. Functions

Advanced functions

Function

Description

Example Expression

Example Result

Split(input, delimiter)

Divides the input string into substrings separated by the delimiter, returning a new table variable with a single value column containing the sub-strings. Note that the delimiter argument must be exactly one character long.

Split("2,89,16", ",")

a table variable with one value column, containing three rows: value = 2, value = 89 and value = 16

IsNull(input, replacement)

Replaces empty input values with the specified replacement value. If the input value is not empty will the value not be replaced.

IsNull("", 0)

0

CSVFill(table(colA,colB,...)

,string,"delimiter")

Creates a table variable from delimited text

CSVFill(table(partNo, qty, unit),decodedString,";")

Creates a table variable with columns partNo, qty, unit based on the decodedString variable which was created using the DecodeText function

DecodeText(input, encoding)

Decodes text encoded as binary data (from a BLOB database column or a File Gallery interaction item). The second argument specifies the encoding from which to decode. Valid values for this argument can be found in the encodings system variable, which is available in all workflows.

DecodeText(myFile.data, encodings.Windows1252)

contents of myFile.data, decoded using the Windows 1252 Character Set

Default(typeValue)

Returns an empty record based on a type value (see Type Definitions).

Default($PurchaseOrders__RowType)

<an empty record matching the type of the PurchaseOrders table variable>

Empty(typeValue)

Returns an empty table based on a type value (see Type Definitions).

Empty($PurchaseOrders__RowType)

an empty table matching the type of the PurchaseOrders table variable

The CASE/WHEN/THEN construct

If you need an expression to return different values depending on the input, you can use the CASE-WHEN-THEN construct.

The example below returns the text "zero" if the value of variable x is 0, the text "negative" if x is less than 0 and the text "positive" in all other cases.

case when x = 0 then "zero" when x < 0 then "negative" else "positive" end

The IN operators

The IN operator allows you to compare one left hand side value (L) with several right hand side values (R) at once. The result of the statement is TRUE if L is equal to any of the values in R.

firstName in ('James', 'Richard', 'Danny')

Truth of Non-Boolean values

FlowScript is fairly permissive when it comes to evaluating the truth of non-Boolean values. The following non-Boolean values count as true:

  • All numbers except 0

  • All strings except the empty string, "0" and "FALSE" (including all upper- and lowercase variants)

The JSON module

The JSON module can be used to transform Flow variables (records or tables) into JSON data and vice versa.

JSON.Decode(data)

The generic Decode function takes a JSON record (as text) and decodes it as the specified type (T). Fields which are present in the type (T) but do not have a corresponding entry in the JSON data will be created with the default value. It is therefore recommended to specify default values for all type structures which will be decoded from JSON.

let data = '{"name" : "Richard", "age" : 28}';
type personType = [name = 'Not specified', age = 0, occupation = 'Unemployed'];

let myPerson = JSON.Decode<personType>(data); // Person will have occupation 'Unemployed' since the key is not present in the json data

return myPerson.age; // Returns 28

JSON.DecodeTable

The generic DecodeTable function takes a JSON table (as text) and decodes it as a table of the specified type (T). Columns which are present in the type (T) but do not have corresponding entries in the JSON data will be created with the default value. It is therefore recommended to specify default values for all type structures which will be decoded from JSON.

let data = '[{"name" : "Richard", "age" : 28}, {"name" : "Samantha", "age" : 21, "occupation" : "Programmer" }]';
type personType = [name = 'Not specified', age = 0, occupation = 'Unemployed'];

let persons = JSON.DecodeTable<personType>(data);

return persons.First().name; // Will return "Richard"

JSON.Encode

The generic Encode function takes any FlowScript record variable and encodes it as JSON.

let animal = [name: 'Cat', numberOfLegs: 4];

return JSON.Encode(animal); // Will return '{"name" : "Cat", "numberOfLegs" : 4.0 }'

JSON.EncodeTable

The generic Encode function takes any FlowScript table variable and encodes it as JSON.

let animals = [name: 'Cat', numberOfLegs: 4] & [name: 'Millipede', numberOfLegs: 1000];

return JSON.EncodeTable(animals); // Will return '[{"name" : "Cat", "numberOfLegs" : 4.0}, {"name" : "Millipede", "numberOfLegs" : 1000.0 }]'
PreviousDate functionsNextTable

Last updated 5 years ago

Was this helpful?

πŸ’‘