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 WHERE keyword
  • The ORDER BY keyword
  • The SUM function
  • The JOIN function
  • The MAP-AS construct
  • CSV data
  • XML data

Was this helpful?

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

Table functions

Function

Description

Example Expression

Example Result

Count(table)

Returns the number of rows in a table.

Count([col: "A"] & [col: "B"])

2

Any(table)

Returns a truth (Boolean) value indicating whether the table has any rows.

Any([col: "A"] & [col: "B"])

TRUE

Skip(table, n)

Returns a table where first n rows have been excluded.

Skip([col: "A"] & [col: "B"] & [col: "C"], 1)

<[col: "B"] & [col: "C"]>

Take(table, n)

Returns a table where first n rows are included in result.

Take([col: "A"] & [col: "B"] & [col: "C"], 2)

<[col: "A"] & [col: "B"]>

First(table)

Returns a record representing the first row of a table.

First([col: "A"] & [col: "B"])

<[col: "A"] as Record>

Sum(table.column)

Returns the summarized value of the specified table column.

Sum([col: "4"] & [col: "7"])

11

All(table, predicate)

Returns a Boolean value indicating whether the predicate expression holds tree for all rows in the table.

All([a: 1] & [a: 2], {a > 1})

false

Eval(table)

Forces evaluation of a lazy table expression. Rarely necessary.

Eval(numbers where x < 0)

<numbers table unchanged>

CsvFill(prototype, data, separator)

Creates a Flow table from a string value containing CSV data.

See below

See below

XmlFill(prototype, data, rootXpath)

Creates a Flow table from a string value containing XML data

See below

See below

The WHERE keyword

You can use the WHERE keyword to create a filtered version of a table variable. Since this filtering happens locally on the device where the Flow client is run, it is not suitable for large amounts of data.

The WHERE keyword takes a table on the left hand side and a logical expression (with the scope of the table's columns) on the right hand side.

Since the WHERE keyword returns a new table, you can nest it in any table function, such as First, Any, Count, etc.

let orders = [id: 1, isConfirmed: 0, plannedDate: Now()] & 
             [id: 2, isConfirmed: 1, plannedDate: Now() + 1] & 
             [id: 3, isConfirmed: 0, plannedDate: Now() + 2];
let futureOrders = orders where isConfirmed and plannedDate > Now();
let nextOrderToProcess = first(orders where isConfirmed);
let numberOfOrder = count(orders where isConfirmed);

The ORDER BY keyword

ORDER BY sorts a table by one column and returns a new sorted table. As default the order is asending but by adding the keyword DESC the order can be changed to descending (ASC can be added for explicitly when sorting ascending). Only simple types can used for sorting.

let items = [id: 1, price: 10, name: 'Soda'] & 
            [id: 2, price: 100, name: 'Burger'] & 
            [id: 3, price: 50, name: 'Fries'];

let cheapItem = First(items order by price);
let expensiveItem = First(items order by price desc);

The SUM function

The Sum function calculates the sum of the values in a numeric column in a table.

let projectedProfit = sum((orders where isConfirmed).value) - sum(expenses.cost);

The JOIN function

The Join function concatenates all values of a table column into a single textual value with a given separator.

In the example below, the orderNo column of the orders table is aggregated into a comma-separated string in the format <orderNo 1>, <orderNo 2>, <orderNo 3> etc.

let orderNumbers = join(orders.orderNo, ', ');

The MAP-AS construct

The Map-As construct is used to create a new table variable based on an existing table variable, changing the column names and adding or removing new columns. The syntax of the map-as construct is MAP <source table> AS <record literal>. The record literal to the right of the AS keyword has the scope of the table.

The example below shows an orderLines table being transformed, keeping the salesPart column but adding a new column called cost, which is calculated using the price and discountPercent columns of the orderLines table.

let newOrderLines = map orderLines as [salesPart, cost: price * discount];

CSV data

The CsvFill function can be used to parse CSV data into a Flow table. In order to do this, the function needs a prototype table, which is an empty table specifying the columns expected in the CSV data. If not all columns are present in the CSV data, the function will fail.

Given the following semicolon-separated CSV:

name;lastName;age
Bob;Smith;50
Alice;Smith;60
Per;Lagerqvist;40

...you can use the CsvFill function as such:

let prototype = table(name, lastName, age);
let result = CsvFill(prototype, csvData, ";");

// the 'result' variable will be a table containing the data from the CSV block

XML data

Similarly, the XmlFill function can be used to parse simple XML data into a Flow table. In order to do this, the function needs a prototype table, which is an empty table specifying the columns expected in the XML data. If not all columns are present in the XML data, the function will fail.

Given the following XML:

<animals>
    <animal>
        <name>cat</name>
    </animal>
    <animal>
        <name>dog</name>
    </animal>
</animals>

...you can use the XMLFill function as such:

let prototype = table(name);
let result = XmlFill(prototype, xmlData, "");

// The 'result' variable will contain two rows corresponding to the <animal>
// elements in the XML above.

PreviousTableNextPrograms

Last updated 5 years ago

Was this helpful?

The third argument of the XmlFill function can be used to specify an pointing out the root element under which each row is found.

πŸ’‘
XPath expression