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
  • Case expressions
  • Function calls
  • Default
  • Error
  • Like
  • In

Was this helpful?

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

Other expressions

PreviousArithmeticNextQueries

Last updated 1 year ago

Was this helpful?

Case expressions

A case expression selects one of several values based on some condition. A case expression consists of at least one case clause and exactly one default case beginning with the else keyword.

let x = random(0, 1);

// Example: flip a virtual coin.
return case when x > 0.5 then "heads"
            when x < 0.5 then "tails"
            else "standing on edge"
            end;

Function calls

FlowScript comes with a number of , and you can .

// Example: call the "upper" function with "hello" for its single argument.
return upper("hello");

Default

Sometimes it is useful to create en "empty" value of some type. You can use the default keyword for this.

type User = {name: text, age: number, email: text?};

return default(User);

Error

The error expression (which doubles as a statement) stops the execution of the application and displays an error message to the user.

if quantity <= 0:
    error "Quantity must be greater than zero."

Like

The like operator is used for simple, SQL-like matching of text values.

return "sweden" like "swe%"; // true
return "sweden" like "norw%"; // false

The value on the right side is referred to as the "pattern".

Wildcards

Wildcards are used to substitute any number of characters in text comparison.

  • %: Matches any sequence of characters, including zero characters.

    • 'sweden' like 'swe%' matches because anything can follow "swe".

    • 'austria' like '%ia' matches because the string ends with "ia".

  • _: Matches exactly one character.

    • 'luxembourg' like 'l_xembour_' matches because "u" and "g" are the single characters in those positions.

Character Sets

Character sets allow you to specify a set of characters, any of which can match a character in the specified position.

  • [...]: Matches any single character within the brackets.

    • 'myanmar' like 'my[a-z]nmar' matches because "a" falls within the range "a" to "z".

    • 'USA' like 'US[AB]' matches because "A" is in the set "A, B".

  • [character-character]: Specifies a range of characters.

    • 'myanmar' like 'my[a-z]nmar' uses a range to specify any letter from "a" to "z".

Negation in Character Sets

You can negate a character set by using ^ as the first character after the opening bracket.

  • [^...]: Matches any single character not within the brackets.

    • 'ukraine' like '[^b]kraine' matches because the first character is not "b".

Case Sensitivity

The pattern matching is case insensitive.

  • 'poland' like 'POLAND' is a match despite differing case.

In

The in operator denotes a boolean value indicating whether the left hand side is contained in the right hand side.

return 1 in [1, 2, 3]; // true
return 0 in [1, 2, 3]; // false

let users = 
    {id: 0, name: "Cleo"},
    {id: 1, name: "Peter"}
];

return 1 in users.id; // true
⏸️
built-in functions
define your own