Flow Help
NovacuraRoadmap
6.12
6.12
  • What is Novacura Flow?
  • 📓System requirements
  • 🎉Release notes
    • Page 1
    • 6.12.2
  • 🎣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
            • Public variables
        • 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
          • 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
              • Getting started
              • Operations
                • Parameters
                  • Computed parameters
                • Outputs
              • Models
                • Custom model member
              • Model transform
              • Global output
              • Global parameters
              • Authorization schemes
              • Enumerations
              • Tools
          • 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
      • 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
  • Example: Append new records to a table
  • Example: Join in to a record
  • Example: Convert a complex table into a simple table

Was this helpful?

  1. Development
  2. Studio
  3. FlowScript

Script examples

PreviousFormatsNextAD sync scripting

Last updated 5 years ago

Was this helpful?

Example: Append new records to a table

#FlowScript # # # # # #

This scrip creates a new table and fills it with data from an already existing table, where one column will be updated with new data.

Input table:

DS_periodDates

date

dayStatus

2019-12-01

Confirmed

2019-12-02

Reported

2019-12-03

3 hours left to report

2019-12-04

8 hours left to report

DS_favorites

customerId

customerName

project

accountDate

3245

abc

4565

2019-12-01

2456

adc

5465

2019-12-01

5974

acb

4564

2019-12-01

Script:

let generatedFavorites = table(customerId, customerName, project, accountDate, objversion, objid);

for recDate in DS_periodDates do

    if recDate.date < now() and (recDate.dayStatus like '%hours left to report' or recDate.dayStatus = 'Reported') then

        for recFavorite in DS_favorites do 

            let addedFavs = recFavorite with [accountDate: recDate.date];

            set generatedFavorites = generatedFavorites & addedFavs;

        done

    end

done

return generatedFavorites; 

Description:

  1. A new table is created: generatedFavorites (row 1 in script below)

  2. The script will loop for every row in table DS_periodDates (3) where the date is in the future and the day status is like '%hours left to report' or 'Reported' (5)

    1. The script will loop for every row in table DS_favorites (7) where the account date in DS_favorites will be updated with the date from DS_periodDates (9)

    2. The script adds the result from each loop iteration to generatedFavorites by concatenating the row with table addedFavs (11)

  3. The script returns generatedFavorites (19)

Output table:

generatedFavorites:

customerId

customerName

project

accountDate

3245

abc

4565

2019-12-02

2456

adc

5465

2019-12-02

5974

acb

4564

2019-12-02

3245

abc

4565

2019-12-03

2456

adc

5465

2019-12-03

5974

acb

4564

2019-12-03

3245

abc

4565

2019-12-04

2456

adc

5465

2019-12-04

5974

acb

4564

2019-12-04

Example: Join in to a record

This script joins values and assign the values to new variables.

Input variables:

Script:

let criticalBugsNoTeamJoinedKey = '0';
let criticalBugsNoProgressJoinedKey = '0';
let criticalBugsNotStaredJoinedKey = '0'; 

if count(criticalBugsNoTeam) > 0 then

set criticalBugsNoTeamJoinedKey = Join(criticalBugsNoTeam.key,'%27%2C%27');

end

if count(criticalBugs) > 0 then

set criticalBugsNoProgressJoinedKey = join(criticalBugs.key,'%27%2C%27');

end 

if count(criticalBugsNotStarted) > 0 then

set criticalBugsNotStaredJoinedKey = join(criticalBugsNotStarted.key,'%27%2C%27');

end 

let joined= [criticalBugsNoTeamJoinedKey: criticalBugsNoTeamJoinedKey, criticalBugsNoProgressJoinedKey: criticalBugsNoProgressJoinedKey, criticalBugsNotStaredJoinedKey: criticalBugsNotStaredJoinedKey]; 

return joined;

Output variable:

Example: Convert a complex table into a simple table

This script will create a simple table where for example join is used to join all components together in to one string so all values can be put in to one column.

Input table:

The input table blockerBugsFiltered is a complex table with differnt levels of tables, records and simple values in the table.

Script:

let blockerBugs = table (key, summary, description, priority, components, assignee, created);

for rec_ in blockerBugsFiltered do 

let joinComponents = join(rec_.fields.components.name, ', ');

set blockerBugs = blockerBugs & [key: rec_.key, summary: rec_.fields.summary, description: rec_.fields.description, priority: rec_.fields.priority.name,
components: joinComponents, assignee: rec_.fields.assignee.displayName, created: left(rec_.fields.created,10)];

done

return blockerBugs; 

Description:

  1. A new table is created: bockerBugs (row 1 in script below).

  2. The script will loop for every row in table blockerBugsFiltered (3).

  3. Join the values in the components table (5).

  4. Append new records to table blockerBugs (7).

  5. The script returns the table blockerBugs (12).

Output table:

The output of this script will be a simple table including only simple values.

#FlowScript # #

#FlowScript # # # #

💡
With
Table concatenation
Create table
Create table
If statement
For loop
If statment
Loop
For loop
Join
Join
Join