Appfarm Documentation
Getting startedDocumentationCommunityAppfarm Create
  • Overview
  • Getting Started
    • What is Appfarm?
    • Key concepts
    • Quickstart
      • Speed intro
      • Step-by-step guide
    • Appfarm Showroom
    • FAQ
  • Appcademy
    • Learning paths
    • Appfarm Fundamentals
      • Intro Course
        • 1. Intro to No-Code and Appfarm
        • 2. Navigation in Appfarm Create
        • 3. What is Apps?
        • 4. Intro to UI Editor
        • 5. Data Model
        • 6. App Data
        • 7. Actions
        • 8. Tips and Tricks
        • 9. Intro to practical walkthrough
        • 10. Create a details view of a Project
        • 11. Create a Custom List
        • 12. Swipe and Delete
        • 13. Functionality for simple Create of Data
        • 14. Upload and Download Photos
        • 15. Input Dialog with Validation and Save
        • 16. Dashboard
        • 17. Summary
        • Quiz
      • User Interface Fundamentals
        • Container - Sectioning, Styling and Repeating
        • Conditional Styles
        • Motions
        • Responsive Design
        • Step-by-step workflow
        • Featured UI Components
        • Quiz
      • App Data Fundamentals
        • Data Source Filtering
        • App Variables and Runtime Properties
        • URL Parameters
        • Quiz
      • Actions & Logic Fundamentals
        • Event Handlers
        • Featured Action Nodes
        • Context Parameters
        • Quiz
      • Services Fundamentals
        • Introduction to Services
        • Setting up a Service
        • Scheduling a Service
      • Integration Fundamentals
        • The web request action node
        • Fetch data from an endpoint
        • Map data to a data source
        • Modify the response
        • Nested data mapping
        • Path parameters
        • Authentication
        • Send data to an endpoint
        • Quiz
      • User handling and permissions
        • Users and roles
        • Permissions
        • Creating users
        • Extending the User object class
        • Updating and deleting users
        • Unauthenticated access
        • Quiz
    • Appfarm Professional
      • User Interfaces
        • Featured UI Components
        • Concepts and Use Cases
      • Data Structures & Data Handling
        • Data Features
        • Search & Filters
        • Featured Action Nodes
        • GraphQL
      • Logic & Flow
        • Logical Concepts
        • Date and Time Handling
        • Featured Action Nodes
        • Exception Handling
      • Login & Configuration
        • Login and Authentication
        • Settings, Configuration and Languages
      • Security & Operations
        • Security and Permissions
        • Deployment
        • Schedules and Logs
        • Debugging and App Health
      • Performance & Optimization
        • Optimizing Performance
        • Enhancing Functionality
    • Appfarm Sales Representative
    • Appfarm Developer Forum
      • Session 1: Data Modeling in Appfarm Create
      • Session 2: App Data in Appfarm Create
      • Session 3: Services in Appfarm Create
      • Session 4: Optimizing Performance
    • Background
      • Databases
        • Data modeling 101
        • Database normalization
  • Library
    • UI components
      • Advanced bar chart
      • Advanced bubble chart
      • Advanced combined chart
      • Advanced gantt chart
      • Advanced heatmap chart
      • Advanced line/area chart
      • Advanced pie chart
      • Advanced scatter plot chart
      • Advanced solid gauge chart
      • Animated component
      • Avatar
      • Avatar group
      • Basic bar chart
      • Basic gauge chart
      • Basic line chart
      • Basic pie chart
      • Bottom navigation
      • Button
      • Checkbox
      • Chip group
      • Circular progress
      • Coded component
      • Container
      • Date & time picker
      • Drawable canvas
      • Floating action button
      • Icon
      • Icon button
      • Iframe
      • Image
      • Linear progress
      • List
      • Map
      • Menu list
      • Multi select
      • PDF reader
      • Popover
      • Radio buttons
      • Rich text editor
      • Rich text
      • Select
      • Slider
      • Speed dial
      • Switch
      • Table
      • Tabs
      • Text
      • Text edit
      • View container
      • Visibility group
    • Action nodes
      • Aggregate data
      • Advanced search
      • Auth operations
      • Block
      • Catch exception
      • Copy to clipboard
      • Create file archive
      • Create file object
      • Create object
      • Create user account
      • Delete objects
      • Delete user account
      • Duplicate objects
      • End execution
      • Exit block
      • Exit loop
      • Export data
      • Foreach
      • Generate document
      • If
      • Import data
      • Invalidate cache
      • Log in
      • Log to console
      • Log out
      • Next iteration
      • Navigate
      • Open/close popover
      • Open confirm dialog
      • Open print dialog
      • Open snackbar
      • Open Unsplash dialog
      • Open URL
      • Persist objects
      • Push notifications
      • Read objects
      • Request permissions
      • Run code
      • Run other action
      • Run service
      • Scan barcode/QR code
      • Send email
      • Send SMS
      • Set client language
      • Set data source attributes
      • Set selection
      • Set theme
      • Set user account image
      • Show install app prompt
      • Sleep
      • Sort objects
      • Throw exception
      • Toggle drawer
      • Update object
      • Update secret
      • Update user account
      • Web request
      • While
  • Reference
    • Appfarm Create
      • Appfarm Commander
      • Blue dots
      • Copy & Paste
      • Farmer's Market
      • Find references
      • Find usage
      • Keyboard shortcuts
      • Undo/Redo
      • User preferences
    • Platform concepts
      • Conditions
      • Data bindings
      • Date and time
      • Event handlers
      • Filters
      • Functions
      • Markdown
      • Objects
      • Operators
      • Value processor
    • Dashboard
    • Apps
      • UI
        • Views
          • Dialog
          • Drawer
        • Layout designer
        • Component properties
        • Shareable UI components
      • Data
        • App variables
        • Data sources
        • Calendar data sources
      • Actions
      • App settings
      • App size
      • App health
    • Services
      • Service Endpoints
      • Service settings
      • Service health
      • API explorer
    • Data model
      • Object classes
      • Object class properties
      • Enumerated types
      • GraphQL
        • Queries
        • Mutations
      • Data Extract API
      • Time series data
    • Operations
      • Deploy
      • Schedules
      • Logs
    • Resources
      • Themes
      • Files
      • Fonts
      • Internationalization
    • Configuration
      • Environments
      • Login
        • Custom auth providers
    • Security
      • Users
      • Service accounts
      • Roles
      • Secrets
      • Permissions
        • Conditional Permissions
    • Appfarm Client
      • Developer tools for Apps
      • Developer tools for Services
      • Warnings and errors
  • How to
    • Data modeling
      • Many-to-many relationships
      • Use naming conventions
      • Offline data handling
      • Data silos and White labelling
    • User interface
      • Manage a many-to-many relationship with a Chip group
      • Configure drag and drop
      • Build a drag-and-drop calendar
      • Design a responsive layout
      • Work with flexbox
      • Use Mapbox as a map layer
      • Understand charts
    • Logic and flow
      • Event Log Design
      • Configure advanced search
    • Themes and styling
      • Change the active theme
      • Add custom email templates
    • Enhance your app
      • Add deep links
      • Add keyboard shortcuts
      • Add link previews for social media
      • Apply SEO best practices
      • Change the active language
      • Generate a PDF from a Container
    • Integrations
      • Integrate with external systems
      • Integrate with OpenAI
      • Integrate with Google Analytics (GA4)
      • Configure a custom email account
      • Integrate with a payment provider
      • Integrate with Signicat
      • Integrate directly with an external database
      • Retrieve a Bearer token from Google Cloud
      • Fetch data from BigQuery
      • Retrieve access token from Microsoft Entra ID
    • Workflow automation
      • Update an OAuth 2.0 access token from a service
    • Authentication and access control
      • Add users and assign roles
      • Configure unauthenticated access
      • Implement third-party authentication
    • Security, testing and deployment
      • Add a custom domain
      • Install an app on a device
      • Get ready for Production
      • Optimize performance
      • Security checklist
      • Test and debug
    • Example apps
      • Create an Instagram clone
        • The end result
        • Designing the feed
        • Create new post
        • Add a like-button
        • Add comment-functionality
  • Solution administration
    • Subscription and billing
    • Dedicated tier benefits
    • Guide to GDPR
      • Key principles
      • How Appfarm protects personal data
      • How you can protect your clients’ data
      • Glossary
    • Appfarm and the EU AI Act
  • Policies
    • Appfarm Policies
    • Data Processors
    • Privacy Policy
Powered by GitBook
On this page
  • Custom app variables
  • Properties
  • Built-in app variables

Was this helpful?

Export as PDF
  1. Reference
  2. Apps
  3. Data

App variables

PreviousDataNextData sources

Last updated 3 months ago

Was this helpful?

App variables is a data source available in every app for storing global app state. App variables contains a number of and you can also .

These variables can be bound to properties in UI components and action nodes, and referenced in and .

Custom app variables

Custom app variables are used to store app state for a given instance of the app. For example, you might need to store a boolean value to track if a component is visible or not, or a datetime value for filtering recently created objects in a list.

App variables are runtime variables, which means that they exist only in the user's browser and are not saved to the database or shared with other users. An app variable will be cleared each time an app is refreshed, unless the Persistence property is populated.

Example: Store the state of a switch to apply a filter

You have a bound to a Tasks data source. You would like to only display uncompleted tasks by default, but you would like to add a Switch component to allow a user to also see completed tasks.

To solve this, you can add a custom app variable called Show completed tasks with data type Boolean and bind this variable to the Switch's Value property. Then you can add a Conditional Filter to the List with the Enabled property set to the conditional expression App Variables.Show completed tasks NOT EQUALS true and the Filter property with the filter expression Tasks.Done NOT EQUALS true.

In this case the conditional filter will apply when the app is loaded, and show only uncompleted tasks, since Show completed tasks will not have value. When a user toggles the switch, the conditional filter will be disabled and all tasks will display.

Properties

Property
Description

Name

The name used throughout Appfarm Create to refer to this app variable. This name can be changed at any time without technical consequences.

Node Name

The key that is used to store the property in memory.

Data Type

Cardinality

Property Type

An app variable can be either be value or a function.

  • Value: A primitive value that can be read and updated.

Value on Create

Available for Value property type. A default value to set for the property when the app is loaded.

Function

Label True

Label False

Available for Boolean data type. A text label to display when the value is false.

Label Undefined

Available for Boolean data type. A text label to display when the value is undefined (empty) or null.

Persistence

Specify if the value should be stored in the user's browser. There are three options:

  • None: The value will not be stored and will only exist in the current instance of the app. This is the default behavior.

  • Local Storage: The value will be stored in the browser's local storage. It will remain there until the user logs out of the app or the login expires. When the value is stored, it will be available for use the next time the app is loaded. If the user has the app open in multiple tabs, the value will be available to all tabs.

  • Session Storage: The value will be stored in the browser's session storage. It will remain there until the user closes the tab, the user logs out of the app, or the login expires. When the value is stored, it will be available for use the next time the app is loaded.

Description

A longer description of the app variable. For your own reference.

Built-in app variables

Property
Data type
Description

Active Currency

Enum

Active Environment

Enum

The environment the end-user is using, either Develop, Test, Staging, or Production. This variable can be useful to alter functionality based on if the active environment uses production data (Staging and Production) or not.

Active Language

Enum

Active Theme

Enum

App Time Zone

Enum

The time zone the app is operating in. By default the device time zone is used, but it can be overridden. Calendar data sources are based on this value. Example: Your App has functionality for registering new Events in Norway, with Start and End time. You want to make sure that the start and end time is "Norway time" when your end users are working remote from Asia. The solution is to set App Time Zone fixed for your App (or based on the Event's location). It may be done with a simple Update Object in the On App Load action (setting App Time Zone to Europe/Oslo)

Client IP

String

The end-user's IP address.

Client Screen Size

Enum

The screen size of the end-user's device, either Large, Medium, Small, or Extra Small. This variable can be useful to show/hide UI components based on the available screen real estate.

Device Orientation

Enum

The current orientation of the end-user's device, either Portrait or Landscape.

Device OS

Enum

The end-user's device operating system.

Device OS Version

String

The end-user's device operating system version.

Document Title

String

This variable can be useful to change the page title dynamically. E.g. you may update this property using an Action with an Update Object action node.

Hostname

String

Is Fullscreen

Boolean

If an app has been installed as a Progressive Web App and is running in fullscreen.

Is Main Drawer Open

Boolean

Is Online

Boolean

If the app is currently connected to the server.

Is Unauthenticated

Boolean

If the user is not logged in and using unauthenticated access.

Notification Permission

Enum

Holds information on whether the user has granted or denied permissions for notifications from this app on this device. The default is Prompt, i.e. the user has not granted or denied permissions. The other possible values are Denied or Granted. The value is changed when the action node Request Permissions is executed, and the value is reset when permissions for the app are reset in the mobile app settings or browser settings.

Readable ID

String

The type of data allowed to be stored in this property. See .

If the Data Type is set to a reference to an Object Class or an Enumerated Type (see ), you have the option to define Cardinality. The default is One, but you may also select Many (storing an array of references instead of a single reference). Read more on the Cardinality setting in the Object Class Properties section .

Function: A that calculates a value at runtime. For example, a function that generates a random number between 1 and 100.

Available for Function property type. A that calculates and returns a value at runtime.

Available for Boolean data type. A text label to display when the value is true. See .

For more information about local and session storage see the .

The built-in app variables contain standard information about an app while it's in use, such as the active environment or client screen size. Some of these variables are based on which can be incorporated into your object classes.

The currency of the Active Language added under . For example, Euro or United States Dollar.

The language the app has applied, based on those added to the solution under . For example, English or Norwegian.

The theme the app has applied, based on those added to the solution under .

The HTML <title> tag. By default, it is the name of the app as specified in . Shown in the browser's title bar or in the page's tab.

The solution hostname for the environment the end-user is using. Given a solution with the short name showroom and all environments available, the following hostnames could be returned: - showroom-dev.appfarm.app - showroom-test.appfarm.app - showroom-stage.appfarm.app - showroom.appfarm.app This variable can be useful to generate the URL for your app based on the active environment, for example when using the .

If the Main Drawer property is set in and the drawer is open.

The readable ID of the app as specified in .

conditions
filters
List component
built-in variables
add your own
function
function
MDN Web Storage API documentation
Internationalization
Internationalization
Themes
Send email action node
here
data types
built-in enums
boolean labels
App Settings
App Settings
App Settings
data types