Flow Connect Help
Roadmap
  • ℹ️This is Flow Connect
    • Overview
    • Technical overview
      • System requirements
    • What's new?
      • Change log
  • ▶️quick start
    • Create an application
    • Create an admin access group
  • 🔁working with Connect
    • Connect to systems
      • Connector agents
        • Add agent group
        • Install agent manager
        • Add agent
        • Manage agent
      • Connectors
        • IFS Applications 10
        • Oracle
        • Microsoft SQL Server
        • Send Email
        • REST
          • Microsoft Graph API
          • Infor M3 REST
            • Obtaining Infor ION API file
            • Configure REST Connector with ION API file
          • IFS Cloud
            • IAM Client Registration
            • Obtaining end-point info from IFS Cloud
            • Configure REST Connector for IFS Cloud
        • File System
      • Redirect URIs
    • Create and design
      • Application packages
      • Applications
        • Create
        • Design
        • Test
        • Commit
      • Portal Pages
        • Create Portal Page
        • Design Portal Page
        • Commit Portal Page
      • Components
        • Create component
        • Manage component
      • Modules
        • Create module
        • Manage module
      • Automations
        • Functionality
        • Create Automation
        • Manage Automation
        • Creating Access Key
        • Executing Automations Externally
          • IFS Cloud
          • Salesforce Apex Trigger Example
    • Deploy
      • Environments
      • Deploy
    • Use
      • On mobile devices
      • In web browser - Web client
      • In web browser - Portal
    • Share
      • Share Applications
    • User administration
      • Users
        • Invite a new user
        • Manage users
      • User groups
        • Create user groups
        • Manage user groups
      • Access
        • Manage access
  • ⏸️Reference
    • How-to guides
      • Create User Step controls
        • Header
        • Static text
        • Labelled static text
        • Link
        • 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
        • Data grid
        • Calendar control
        • Image selection input
        • List presentation
        • Camera Input
      • Dependent controls in User step
        • Variable source
        • Expression source
        • Control visibility (condition to hide)
      • Configure SSO for Microsoft Entra
    • Reference
      • Clients
        • Settings
        • My data
      • Designer
        • Controls
          • 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
          • Data grid
          • Calendar
          • Image selection input
          • List presentation
          • Camera input
          • File gallery
          • GPS location input
          • Signature capture input
          • Item creation sub task
          • Check list sub task
          • Verb sub task
        • Steps
          • Start
          • User interaction
          • External system
          • Decision
          • Assertion
          • HTTP requests
          • Assignment
          • Table
          • Event listener
          • Checkpoint
          • Script
          • Annotation
          • End
          • Local data resource
      • Portal
        • Design items
          • Portlets
            • Accumulation chart
            • Base chart
            • Circular gauge
            • Custom content
            • Data tree
            • Document viewer
            • Filter
            • Kanban
            • KPI card
            • Link
            • My apps
            • Record
            • Rich text
            • Table
          • Container
          • Common portlet configuration
            • General
            • Events
            • Data
            • Custom buttons
            • Style
        • Portal settings
          • Branding
          • Page
          • Navigation
        • Profile
        • Portlet actions
        • Cache
        • Input to Start Step
      • Diagnostic mode
      • FlowScript
        • Walkthrough
          • Introduction
          • Expressions and programs
          • Anatomy of a program
          • Variables
          • Simple types
          • Nullable types
          • Records
          • Sequences
          • Other types
          • Arithmetic
          • Other expressions
          • Queries
          • Conditionals and loops
          • Function definitions
          • Built-in functions
          • DateTime module
          • Seq module
          • HTTP module
          • CSV module
          • JSON module
          • Trace module
          • Record module
          • XML Module
          • Filesystem Module
          • Custom modules
          • Custom Types
          • Appendix: Subtyping rules
          • Appendix: Escape sequences
          • Appendix: Type checking errors
      • Flowscript Copilot
      • Glossary
    • Flow Connect Downloads
      • Install Flow Connect Designer
    • Migrate from Flow Classic
      • Portal - migrate from Flow Classic
      • Classic vs. Connect Comparison Guide
Powered by GitBook
On this page
  • Statements
  • Case and whitespace
  • Comments
  • Return

Was this helpful?

  1. Reference
  2. Reference
  3. FlowScript
  4. Walkthrough

Anatomy of a program

PreviousExpressions and programsNextVariables

Last updated 1 year ago

Was this helpful?

On this page, you will learn about the basic anatomy of the FlowScript programs you can write in script steps.

Statements

A FlowScript program consists of a series of statements. When your application is run and reaches a script step, the program statements inside it are executed top-to-bottom.

Statements are generally terminated by a semicolon (;) character. While not mandatory, the semicolons are recommended, as they help FlowScript give you better error information should you make a typo somewhere in the code.

The following example shows a program consisting of two statements. The first statement declares a called x and assigns it the value 1, and the second statements uses the return keyword to end the script with the value of x as its final result.

let x = 1;
return x;

Case and whitespace

FlowScript has case sensitive identifiers. The variable name user is considered distinct from the variable name User.

However, all language keywords are case insensitive. The following is valid:

RETURN 1;

For reasons of backward compatibility with Flow Classic, the names of built-in functions are also case insensitive.

In some languages, white space is a significant part of the syntax, but this it not the case in FlowScript. You may choose freely where to use white space characters such as tabs, line breaks and spaces.

Comments

You can write comments in your program. These are ignored when the application is run. There are two ways to write comments:

// Text that is prefixed by a double slash is called a line comment.
// Such a comment continues until the next line break.

let x = 1;

/* This is called a stream comment, and it begins with a slash
   followed by an asterisk.
   A stream comment may span over several lines.
   You must 'close' a stream comment by an asterisk followed by a slash. */
   
return x;

Return

A return statement ends the execution of a program and provides a result. Programs must always end with some result.

// Example: end the program and provide the number zero as its result.
return 0;

Any statement placed after a return statement is ignored.

// Example: a program with two return statements.

return 1; // This ends the program with the result 1.
return 2; // This will be ignored, because the program has already ended.
⏸️
variable