LogoLogo
  • Adapptio User Documentation
  • Getting Started
    • Quickstart
    • Architecture Overview
      • Views
      • Actions
      • Integrations
      • API Endpoints
      • Routes
      • Events
      • Assets
    • Editor
      • Main Menu
        • Create New Resources
        • Manage the Application
        • Monitoring Errors
      • Main Toolbar
        • Deploying the Application
        • Opening the Application
        • Preview Mode
        • Error Monitor
      • Components Panel
        • Components
        • Inspector
        • View Settings
      • Outline Panel
        • Data Variables
          • State Variable
          • Data From Action
      • Data Explorer
      • Console
    • Playground
  • Working with Adapptio
    • Best Practices
    • Tutorials
      • 1. Hello World
      • 2. Visualize Data from API
      • 3. Advanced Layout Application
      • 4. Application with In-Memory Database
    • How To
      • Custom Auth
      • Action Logic
        • Transform Node
      • UI Logic
        • Logout
        • Conditional Render
        • One Of
      • Data & Dynamic values
        • Custom Variable
        • Data from Action
        • Dynamic Value
        • Change Value from Event
        • Loading Data from Action to Form
        • Sending Data to Action from a Form
        • Server-side Dropdown Autocompletion
      • Visual
        • Styling Icon Button
      • Layouts
        • Centered Box
        • Header & Sidebar Layout
        • Grid Form Layout
        • Stretched Layout in Row
    • Components
      • Composed Chart
      • Advanced Table
      • Custom Component
    • Examples of Applications
      • SaaS Platforms
      • Customers Portals
      • Information Systems
      • Internal Tools
        • Color Picker
      • IoT Applications
      • Smart Portals
      • Analytics & Calculators
      • Statistics & Monitoring Panels
      • API Data Visualization
      • Simple Games
  • DEPLOYMENT
    • Cloud Hosted
    • Self Hosted
  • REFERENCE GUIDE
    • Components List
      • Application Header
      • Box
      • Container
      • Grid
      • Sidebar Layout
      • View
      • Text Input
      • Number
      • Checkbox
      • Option
      • Date and Time
      • File Upload
    • Properties
      • ACCEPT
      • CUSTOM PLACEHOLDER
      • DESCRIPTION
      • ENABLED
      • FONT SIZE
      • FOREGROUND COLOR
      • FORM DATA KEY
      • HEADERS
      • ICON
      • ID
      • LABEL
      • METHOD
      • MULTIPLE
      • MAX FILE SIZE
      • REQUEST TIMEOUT
      • REQUIRED
      • READ-ONLY
      • SIZE
      • TEXT ALIGNMENT
      • TEXT STYLE
      • URL
      • UPLOAD IMMEDIATELY
      • VALIDATE
      • VALUE
    • Functions
      • Array
      • Date
      • Generators
      • JSON
      • Logic
      • Math
      • Object
      • String
      • Types
      • Util
  • Support
    • Get in touch
    • Release Notes
  • Legal
    • Terms and Conditions
    • GDPR
Powered by GitBook
On this page
  • Array Push
  • Array Splice
  • Array Sum
  • Array Map
  • Array Filter
  • Array Reduce
  • Array Find
  • Includes

Was this helpful?

  1. REFERENCE GUIDE
  2. Functions

Array

Array Push

Add an newItem to the end of an array.

Expression:

ARR_PUSH(stack: array[], newItem: any)

Return:

array[]

Example of usage:

ARR_PUSH(["apples","pears"], "oranges")

Return value:
["apples","pears","oranges"]

Array Splice

Trim an array of elements bordered by indexes; optionally, can add new elements.

Expression:

ARR_SPLICE(stack: array[], index: number, deleteCount: number, newItems?: any)

Return:

array[]

Example of usage:

ARR_SPLICE(["apples","pears","oranges"], 0, 2, "bananas")

Return value:
["oranges","bananas"]

Array Sum

Returns a sum of all numeric values of Array elements.

Expression:

ARR_SUM(stack: array[])

Return:

float

Example of usage:

ARR_SUM([1, 2, 3])

Return value:
6

Array Map

Returns second argument (as an expression) for each array element.

Variables item, index are available in the expression, representing listed item.

Expression:

ARR_MAP(stack: array[], filter: expression)

Return:

array[]

Example of usage:

ARR_MAP([{a:"hello", b:"bye"},{a:"hi", b:"see ya"}], item.a)

Return value:
["hello","hi"]

Array Filter

Return matched array pattern in comparison with the second expression argument.

Variables item, index are available in the expression, representing listed item.

Expression:

ARR_FILTER(stack: array[], filter: expression => boolean)

Return:

array[]

Example of usage:

ARR_FILTER(["hello","hi","how are you"], item == "hello")

Return value:
["hello"]

Array Reduce

Reduces provided array by calling a second argument (as an expression).

Variable 'previousValue', 'currentValue' and 'currentIndex' are available in an expression.

Expression:

ARR_REDUCE(stack: array, {previousValue || currentValue || currentIndex})

Return:

float

Example of usage:

ARR_REDUCE([1, 2, 3, 4], previousValue + currentValue)

Return value:
10

Array Find

Returns array of indexes for which the expression returns true.

Variable 'item' and 'index' are available in the expression.

Expression:

ARR_FIND(stack: array, filter: expression)

Return:

array[]

Example of usage:

ARR_FIND(["apples","pears","oranges"], item == "oranges")

Return value:
[2]

Includes

Returns true if an item is included in an array.

Expression:

INCLUDES(array: any, item: any)

Return:

boolean

Example of usage:

INCLUDES([1,2,3],2)

Return value:
true
PreviousFunctionsNextDate

Last updated 2 years ago

Was this helpful?