Variables

You can use variables in applications to dynamically provide information about the current user, the currently selected item or items, and other types of information. Variables are evaluated at runtime when the application is used.

You can use a category prefix (item or user) with variable names to make the relationship explicit, especially in cases where variable names are the same, such as name. If a variable is not prefixed by any category, item is used as the category.

For example, to specify the folder or file name, use item.name. To specify the user name, use user.name. If you specify name without the category, then item.name (the folder or file name) is assumed.

Folder and File Item Variables

The following variables are specific to a folder or file item that is currently selected by the user. Folder and file variables belong to the item category. The following table lists variables that apply to both folder and file items.

Folder or File Variable Description

id

Item GUID

name

Item name

description

Item description

type

Item type

parentid

Item parent ID

ownerId

Item owner GUID

ownername

Item owner name

creatorname

Item creator name

createdat

Date and time item was created

lastmodifierid

GUID of the user who most recently modified the item

lastmodifiername

Name of the user who most recently modified the item

modifiedat

Date and time the item was last modified

size

Size of the item

permissions

Actions the user is allowed to perform on the item

state

State of the item

applink

Applink created by AIF for this user to access the item, if appLinkRole was specified in the invoke command

The appLink object has id, url, and accessToken properties that can be passed in the URL or data as {appLink.id}, {appLink.url}, and {appLink.accessToken}, respectively.

favorite

Whether the item is a favorite of the user or not

File-Item Specific Variables

The following variables are specific to a file item that is currently selected by the user. File variables belong to the item category. The table lists variables that apply to file items only.

File Variable Description

originalname

Original name of the item

extension

Extension of the item

revision

Item’s revision

mimetype

Mime type of the item

reservedbyid

GUID of the user who reserved the item

reservedbyname

Name of the user who reserved the item

reservedat

Date and time when the item was reserved

isreservedbyanotheruser

Whether the item is reserved by a user other than the current user

Item Permissions

Permissions is a JSON object that you can query to determine the permissions associated with an item. The properties return a Boolean value.

Permission Properties Description

annotationDelete

User has delete permission for annotations on the item.

annotationRead

User has read permission for annotations on the item.

annotationUpdate

User has update permission for annotations on the item.

annotationWrite

User has write permission for annotations on the item.

directShareDelete

User has delete permission for the item shared with the user.

directShareRead

User has read permission for the item shared with the user.

directShareUpdate

User has update permission for the item shared with the user.

directShareWrite

User has write permission for the item shared with user.

fileDelete

User has delete permission for the file.

filePreview

User has preview permission for the file.

fileRead

User has read permission for the file.

fileUpdate

User has update permission for the file.

fileWrite

User has write permission for the file.

folderDelete

User has delete permission for the folder.

folderPreview

User has preview permission for the folder.

folderRead

User has read permission for the folder.

folderUpdate

User has update permission for the folder.

folderWrite

User has write permission for the folder.

linkShareDelete

User has delete permission for the item shared with the user through a link.

linkShareRead

User has read permission for the item shared with the user through a link.

linkShareUpdate

User has update permission for the item shared with the user through a link.

linkShareWrite

User has write permission for the item shared with the user through a link.

Item State

State is a JSON object that you can query to determine certain states of an item. The properties return a Boolean value.

State Property Description

isAnnotated

The item has annotations.

isAnnotatedLatest

The item has the most recent annotations.

isLinked

The item has named sharing links defined for it.

isShared

The item is directly shared with specified users.

isSyncd

The item is included in the content synced through the desktop client.

isInTrash

The item is currently in the trash.

User Variables

The following variables are relative to the current user or session, or both.

Variable Description

id

User’s GUID

name

User’s name

loginname

User’s sign in name

email

User’s email address

timezone

User’s time zone

ismember

Returns true if the user is not accessing an item through public link or app link and false otherwise

ispubliclink

Returns true if the user is accessing the item through a public link and false otherwise

isapplink

Returns true if the user is accessing the item through an applink and false otherwise

role

Current user's role for an item

hasprivilegesas

Specified with a user role as a string argument to determine if the user has the specified role

API Functions

Use the following utility functions with evaluate or invoke expressions to return information about a specified item.

Variable Description

isReservedByAnotherUser(item)

Returns true if the item is reserved by another user, or returns false otherwise

hasPrivilegesAs(item, role)

Returns true if the user has role privileges for the item, or returns false otherwise

getUserRole(item)

Returns the user’s role for the item