The AppAPI allows users to load system meta data from the app using different methods in the FormEngine and DMView. It provides access to various data keys for retrieving specific information from the app.

In the xlsform, you can use the pulldata() function with the following syntax:

  • 'app-api': This keyword informs the FormEngine to load the data from the App API.
  • 'data-key': This is the key of the data you want to load from the App API.
  • If the data key is invalid or not supported, the calculation will return “n/a”.

Here are the supported data keys that you can use with the App-API:

osPlatform: Returns the current OS name (Android or iOS) and the OS version. Web platforms will return an empty value.

appPlatform: Returns the app platform name, whichs is rtSurvey.

appVersion: Returns the app’s version name.

getDisplayWidth: Returns the device screen width in pixels.

getDisplayHeight: Returns the device screen height in pixels.

getScreenSize: Returns the device screen size in inches.

projectCode: Returns the current project code of the site the user is signing in to.

projectURL: Returns the current project URL of the site the user is signing in to. The default/fallback value is an empty text ("").

startingPoint: Returns the path of the point that starts the form. Refer to the “Form starting point” for more details.

serverTime: Returns the best available approximation of the date and time on the server.

user.[attribute]: Returns the current user attributes based on the specified attribute key. Refer to the “User attributes” table for available attribute keys.

Combine the below attribute keys with “user.” in the pulldata() params to retrieve the current user information. For example, use user.username, user.email, etc.

Attribute KeyDescription
usernameUsername of the user
nameFull name of the user
staffCodeUser’s staff code
phonePhone number of the user
emailEmail address of the user
descriptionDescription text in user information
organization_idOrganization ID the user belongs to
organization_nameOrganization name the user belongs to
team_idTeam ID the user belongs to
supervisor_idID of the user’s supervisor
user_roleUser role
user_groupUser group
is_supervisor1 if the user is a supervisor, 0 if not
auto_approve_edit_request1 if the user is allowed to approve automatic “request to edit”, 0 if not
ipcall.userIP Call account’s parameter - username
ipcall.tokenIP Call account’s parameter - token
ipcall.passwordIP Call account’s parameter - password
ipcall.urlIP Call account’sparam - URL
ipcall.authIP Call account’s parameter - auth (optional)
ipcall.portIP Call account’s parameter - port (optional)

instancePath: Returns the current instance folder path.

appLanguage: Returns the current app language set in the app’s settings (e.g., vi, en).

openArgs.[attribute]: Returns the open-form-argument passed from the ActionButton (act_fill_form, act_get_instance). The default/fallback value is an empty text ("").

primaryAppColor: Retrieves the app’s primary color.

Was this page helpful?