website logo
👥 Community🎯 Samples on GitHub🚦System Status
💡 Guides
🚀 Examples
🍕 Developer Reference
⚡️ Changelog
🎥 Video Library
Navigate through spaces
⌘K
Examples Overview
Setting up your solution
Jig Types
Components
Datasource
Actions
Preview
Widgets
Expressions
Aggregation
Boolean
Comparison Operators
Date & Time
Path Operators
Functional Programming
Jigx Variables
Predicate Queries
String
Docs powered by
Archbee
Expressions

Jigx Variables

18min

 has a set of variables that can be used in expressions to manipulate data specific to a , for example, determining the logged-in user, or the  organization and solution.

Organization

The organization variable is used to get information about the actual organization in , such as your organization's id.

Configuration

Result

Expression

id

=@ctx.organization.id

Examples and code snippets 

Organization expression
Organization expression


This example returns the organization's id . Each organization configured in Organization Settings in and will have a unique id. See the full code sample in GitHub.

YAML
|
children:
  - type: component.entity
    options:
      children:
        - type: component.entity-field
          options:
            label: Organization ID
            value: =@ctx.organization.id


System

The system variable in an expression is used to get information about devices, for example, you can find information about the internet connection of the device, the language preference, the device's timezone and location details. System expressions are configured by =@ctx.system. followed by the specific variable name.

Configuration

The supported variables for the system variable are:

Result

Expression

isOffline

=@ctx.system.isOffline = true

locale

=@ctx.system.locale

timezone

=@ctx.system.timezone.offset

geolocation

Accuracy: =@ctx.system.geolocation.coords.accuracy Altitude: =@ctx.system.geolocation.coords.altitude Altitude Accuracy: =@ctx.system.geolocation.coords.altitudeAccuracy Location - Heading: =@ctx.system.geolocation.coords.heading Location - Latitude: =@ctx.system.geolocation.coords.latitude Location - Longitude: =@ctx.system.geolocation.coords.longitude Location - Speed: =@ctx.system.geolocation.coords.speed Location - Timestamp: =@ctx.system.geolocation.timestamp Location - Entire array (All details): =$string(@ctx.system.geolocation)

isLocationSharingEnabled

=@ctx.system.isLocationSharingEnabled

solution

=@ctx.solution.id

user

=@ctx.user.email or =@ctx.user.id

Examples and code snippets

System isOffline

System expression
System expression


With this expression, you can disable the action button to prevent it from being pressed if the device is offline.

See the full code sample in GitHub.

isOffline.jigx
|
actions:
  - children:
      - type: action.go-to
        options:
          style:
            isDisabled: =@ctx.system.isOffline = true
          title: Go to action
          linkTo: advanced-expressions






System timezone

This example uses system.timezone to get the information about the device's timezone, it can be the name of the timezone or the offset. Use it further to convert date/time using Date & Time expressions into the format that you require.

See the full code sample in GitHub.

YAML
|
children:
  - type: component.entity
    options:
      children:
        - type: component.entity-field
          options:
            label: Timezone name
            value: =@ctx.system.timezone.name
        - type: component.entity-field
          options:
            label: Timezone offset
            value: =@ctx.system.timezone.offset




System timezone expression
System timezone expression


System geolocation

system geolocation expression
system geolocation expression




This example shows how you can use system.geolocation to get the device's location (details).

See the full code sample in GitHub.

YAML
|
children: 
  - type: component.entity
    options:
      children:
        - type: component.entity-field
          options:
            label: System Location - Accuracy
            value: =@ctx.system.geolocation.coords.accuracy
        - type: component.entity-field
          options:
            label: System Location - Altitude
            value: =@ctx.system.geolocation.coords.altitude
        - type: component.entity-field
          options:
            label: System Location - Altitude Accuracy
            value: =@ctx.system.geolocation.coords.altitudeAccuracy
        - type: component.entity-field
          options:
            label: System Location - Heading
            value: =@ctx.system.geolocation.coords.heading
        - type: component.entity-field
          options:
            label: System Location - Latitude
            value: =@ctx.system.geolocation.coords.latitude
        - type: component.entity-field
          options:
            label: System Location - Longitude
            value: =@ctx.system.geolocation.coords.longitude
        - type: component.entity-field
          options:
            label: System Location - Speed
            value: =@ctx.system.geolocation.coords.speed
        - type: component.entity-field
          options:
            label: System Location - Timestamp
            value: =@ctx.system.geolocation.timestamp
            contentType: time
        - type: component.entity-field
          options:
            label: System Location - Entire array (All details)
            value: =$string(@ctx.system.geolocation)



System isLocationSharingEnabled

See the example using dynamic data in GitHub.

YAML
|
  onFinish: 
            type: action.confirm
            options:
              isConfirmedAutomatically: false
              onConfirmed: 
                type: action.go-back
              modal:
                title: Enjoy your pizza
      # Add the ability to stop sharing your location 
      - type: action.stop-location-sharing
        when: =@ctx.system.isLocationSharingEnabled
        options:
          title: Stop sharing

Document image


User

Examples and code snippets

The user is used to get information about the logged-in user, for example, name, and email.

Configuration

Result

Expression

Name

=@ctx.user.displayName

Email

=@ctx.user.email

id

=@ctx.user.id

User expression
User expression


See the full code sample in GitHub.

user.jigx
|
children:
  - type: component.entity
    options:
      children:
        - type: component.entity-field
          options:
            label: User Display Name
            value: =@ctx.user.displayName
        - type: component.entity-field
          options:
            label: User Email
            value: =@ctx.user.email
        - type: component.entity-field
          options:
            label: User Id
            value: =@ctx.user.id


Solution

The solution variable is used to get information about the specific  solution, for example, name, and id.

Configuration

Result

Expression

Name

=@ctx.solution.name

id

=@ctx.solution.id

Examples and code snippets

Solution expression
Solution expression


This example shows how to get the solution's id and name using the solution variable.

See the full code sample in Github.

YAML
|
children:
  - type: component.entity
    options:
      children:
        - type: component.entity-field
          options:
            label: Solution ID
            value: =@ctx.solution.id
        - type: component.entity-field
          options:
            label: Solution Name
            value: =@ctx.solution.name




Updated 28 Jul 2023
Did this page help you?
PREVIOUS
Functional Programming
NEXT
Predicate Queries
Docs powered by
Archbee
TABLE OF CONTENTS
Organization
Configuration
Examples and code snippets
System
Configuration
Examples and code snippets
System isOffline
System timezone
System geolocation
System isLocationSharingEnabled
User
Examples and code snippets
Configuration
Solution
Configuration
Examples and code snippets
Docs powered by
Archbee
Copyright © 2023 Jigx, Inc. All rights reserved. Terms of Service