User guide
Quick Start Guide
Case notes
Table component
FAQ
Search
Dashboard
Deleted Documents and Access Log
Solving a task
AI Assistant
Manuals
Substitution and Vacation
Suspending, resuming, archiving and deleting a case
Case variables, history and graph
Basic Terms
Uploading Documents, Folders and Revisions
News
Favorites
Navigating the interface
Dashboard widgets
Case Detail
News/Announcements in Team assistant
Case list
Logging In and Out
Account Settings
Task List
Mobile app settings
Reports and Charts
Searching and Listing Documents
Handing Over, Taking Over and Tasks to Pull
Bulk Tasks
Printing a Case
Creating and Editing an Overview
What Is TAS
Form Fields
Tablet Interface and NFC
Overviews
Creating a New Case
Case Events
Case Permissions
Subscribing to an overview by email
Administrator Guide
Platform guide
Administration
Crons
Authentication and Synchronization
SMTP OAuth authentication
LDAP, SAML, Entra ID and NFC: Settings
Configuring authentication modules
Authentication
Vault
DMS attributes
Service Operations
Mobile App Setup for Your Environment
Scheme
XML Process Import
HR agenda and agenda handover
Logs
Archiving
Scripts
Sequences
System Status
News Management
Migrations
Configuration
Plugins
Email Queue
Service Console
AI monitoring
Shared Files
Settings
CSP Headers
CSV Files
Scheduled Tasks
Processing Queues
Maintenance
Administration Menu
Licenses
Dynamic Tables
Usage Statistics
Access Token Settings & Session Expiration
Visual Identity
Template
Prints
Tasks
Task calculations
Automatic task completion and cancellation
Email Task and Notifications
Task types
Smart Event task
Instructions, Sections and Testing a Task
General task settings and solver
Multi-instance
Planning: start, branching and due date
Dynamic conditions: builder
Variable assignment and sections
Variables
Class diagram, object state import and alias candidates
Document list
Text and Multiline text
Checkbox
Number
Variables: overview and common settings
Lists (texts, numbers, dates)
Dynamic Rows
Date
Dynamic list
Sequence
Dynamic Table
Shredding Process
Template graph
Template Tab
Template List
Importing, Exporting and Copying a Template
Template Headers
Case statuses
Roles
Connecting to a different database
Diagnosing services
Hyper-V: Isolated NAT Network with Port Forwarding
Users
Translations
NFC Integration
Events and Rules
AXIOS API
Plans
Axios with Vault
Users
Axios with SSL Certificate
User Detail
Calculations & Functions
Form condition
Other dynamic conditions
Optimization of API calls on dynamic conditions
Filtering in a dynamic sheet using dynamic conditions
Dynamic Conditions: Script
Dynamic Rows: Script
Calculations
Dynamic Tables
Printing and File Generation
Documents in Calculations — Complete Guide
Printing and File Generation in Calculations
DOCX document creation
Other Calculations
How and when calculations run
Calculations API reference: the lib library
Calculations API reference: variables and case
Global Scripts and React Scripts
Integrations
MS Graph
MS Graph - cron configuration
MS Graph v2 (from v5.7.102)
MS Graph - preparing the mailbox
MS Graph (email)
ISDOC.PDF
DocuSign
TAS call module - TAS 2 TAS (process creation via API)
DB View
DocuSign and electronic signatures
ERP and other integrations
Smart Events for Integrations
TAS Forms
TAS Forms
Activating the module on the environment
TAS Forms - secret creation guide for Docker Swarm
Advanced Features & Tips
Filtering in a dynamic sheet using a URL parameter (static)
Optimizing Overviews with a Large Number of Cases
API Documentation
Product
Technical Changelog
Business Changelog
Version Upgrade Guide
Upgrade to v5.19
Upgrade to TAS 5.19 - Key Changes and Removed Features
Upgrading TAS 5.17 to 5.19 – Technical Part (DevOps)
Upgrate to v5.17
Upgrade to TAS 5.17 - Key Changes and Removed Features
Asset Migration from FE to Backend (5.17 Upgrade) — DevOps
Upgrading to v5.7
Lodash upgrade v4.17.x (>v5.5)
Main changes and deprecated features (v5.3 > v5.7)
Highlighting variables in Read-only status (>v5.7.58)
Upgrading to 5.3
Dynamic conditions migration
PDF printing adjustment
Editing Task Description vs Task Instructions
Transpiling forEach to a for loop
Rendering HTML on Caseoverview
Differences between TAS4 and TAS5 - a complete overview
Best Practices for Upgrading from v4 to v5
Using validation functions
Technical details
Server prerequisites
Security and Data Protection
Security
TAS Operations Runbook
Technological architecture
News / Important information
Microsoft Disabling Basic Auth for SMTP
End of EWS support and transition to Microsoft Graph
Adjustment in EWS after MS Exchange update (29.04.2025)
Security notices
Getting Started
- All Categories /
- Administrator Guide
- Calculations & Functions
- Calculations /
- Calculations API reference: variables and case
Calculations API reference: variables and case
This article is a reference for the vars, proc, task, snaps and dr objects available to code on the Calculations tab of a task (see How and when calculations run). Signatures and behaviour correspond to TAS version 5.19.12. The lib library of general functions and other services (ai, axios, ftp...) are described in the article Calculations API reference: lib library. Dynamic Tables (dt) have their own article, Dynamic Tables in calculations.
The screenshot shows an example from the Fill in the travel request task of the "Travel request" sample template: if the Traveller variable is empty, the calculation fills in the case owner when the task starts.

if (!vars['traveller'].getValue()) {
vars['traveller'].setValue(proc.IPROC_INST_OWNER_USER_ID);
}vars – case variables
vars is an array of all case variables, keyed both by name (TVAR_NAME) and by ID (TVAR_ID): vars['Supplier'] and vars['482'] return the same object. You can also read the variable's column values directly from the object, for example vars['Supplier'].IVAR_TYPE.
| Method | Returns | Description | Example |
|---|---|---|---|
getValue(language?) | variable value | Value of the variable according to its type (for DT it returns the row index, for DR a JSON string). | const total = vars['TotalPrice'].getValue(); |
setValue(value) | Promise<void> | Sets a new value. For a dynamic list, set null to clear it. | await vars['Approved'].setValue(true); |
getJSON() | object | Variable value broken down into JSON (for Select/DL an object {value, title}). | const supplier = vars['Supplier'].getJSON(); |
getJSONAttr(key) | value | Reads a single property of the JSON value. | vars['Supplier'].getJSONAttr('title'); |
setJSONAttr(key, value) | Promise<string> | Sets a single property of the JSON value and saves it. | await vars['Meta'].setJSONAttr('note', 'OK'); |
getTitle() | value | Text form of the variable – for DT it returns the Title of the selected row, otherwise the same as getValue(). | vars['Country'].getTitle(); |
getIndex() | value | For DT the text value of the item, for a dynamic list (user/role/org. unit) the id (an array of ids for multi-select), otherwise the same as getValue(). | vars['Approver'].getIndex(); |
getName() | string | Variable name (TVAR_NAME). | vars['Supplier'].getName(); |
getDR(col) | string | Values of a column of a Dynamic Rows variable as JSON. | vars['Items'].getDR('unitPrice'); |
isChecked() | boolean | Is the checkbox variable checked? | if (vars['UrgentFlag'].isChecked()) { ... } |
getFileStream(encoding='binary') | stream | File content of an attachment variable. | const stream = await vars['Quote'].getFileStream(); |
setAttribute(attrName, value) | Promise<void> | Saves the value of any column of the variable (e.g. IVAR_NAME_CS). | await vars['Supplier'].setAttribute('IVAR_LABEL', 'Dodavatel'); |
For a select-from-list variable,
getValue() is often just the selected value, whereas getJSON()/getTitle() also return the label. If you need both the value and the text, use getJSON().task – current task
task exposes the columns of the instance task table (INSTANCE_TASKS) directly as properties, e.g. task.ITASK_NAME, task.ITASK_COMMENT, task.ITASK_DUE_DATE_FINISH. ITASK_ID and TTASK_ID are read-only.
| Method | Returns | Description | Example |
|---|---|---|---|
setAttribute(attrName, value) | Promise<void> | Saves a new value of a task column to the database. Throws an exception for ITASK_ID/TTASK_ID. | await task.setAttribute('ITASK_COMMENT', 'Schváleno manažerem.'); |
getTaskLink() | string | Frontend URL of the task. | const url = task.getTaskLink(); |
getOwnerUserName() | Promise<string> | Display name of the task solver. | await task.getOwnerUserName(); |
getSolvedByUserName() | Promise<string> | Display name of the user who completed the task. | await task.getSolvedByUserName(); |
Common system values available via task/proc (the Insert variable field in the editor offers the same expressions):
| Expression | Returns |
|---|---|
task.ITASK_NAME, task.ITASK_COMMENT, task.ITASK_DESCRIPTION, task.ITASK_INSTRUCTION | Task name, comment, description and instructions. |
task.ITASK_DUE_DATE_START, task.ITASK_DUE_DATE_FINISH | Planned start and due date of the task. |
task.ITASK_ACTUAL_DATE_START, task.ITASK_ACTUAL_DATE_FINISH | Actual start and completion of the task. |
task.ITASK_USER_ID, task.getOwnerUserName() | Task solver – id and name. |
task.ITASK_FINISHED_BY_USER_ID, task.getSolvedByUserName() | Who actually completed the task – id and name. |
proc – current case
proc exposes the columns of the instance process table (INSTANCE_PROCESSES) in the same way as task, e.g. proc.IPROC_NAME, proc.IPROC_INST_OWNER_USER_ID. IPROC_ID and TPROC_ID are read-only.
| Method | Returns | Description | Example |
|---|---|---|---|
setAttribute(attrName, value) | Promise<void> | Saves a new value of a case column. | await proc.setAttribute('IPROC_DESCRIPTION', 'Objednávka Q1'); |
getCaseLink() | string | Frontend URL of the case. | proc.getCaseLink(); |
getCaseOwnerName() | Promise<string> | Display name of the case owner. | await proc.getCaseOwnerName(); |
getCaseNotes(asObject?) | Promise<string | any[]> | Case notes. Without a parameter, HTML text with line breaks; with true, an array of objects {userFullName, userDisplayName, taskName, dateTime, note}. | const notes = await proc.getCaseNotes(true); |
setCaseStatus(value) | Promise<void> | Saves a freely defined text status of the case (IPROC_CASE_STATUS) – independent of the system status of the process. | await proc.setCaseStatus('WAITING_FOR_SUPPLIER'); |
getCaseStatus() | string | Current IPROC_CASE_STATUS. | if (proc.getCaseStatus() === 'WAITING_FOR_SUPPLIER') { ... } |
getTemplateTasksInfo() | Promise<Record<string, any>> | Metadata of template tasks keyed by TTASK_NAME – useful for mapping localised task names in other languages. | const tasks = await proc.getTemplateTasksInfo(); |
// Poznámka k případu se zápisem i čtením zpět
await debug.log('Order approved by manager.');
const history = await proc.getCaseNotes(true);
vars['LastNote'].setValue(history.at(-1)?.note ?? '');snaps – variable snapshots
snaps['Name'] gives access to a snapshot (frozen) copy of a variable, for example the value saved at a specific approval step. It is only available in the task context (Task-JS).
| Method | Returns | Description |
|---|---|---|
getName() | string | Name of the snapshotted variable. |
getValue() | value | Snapshot value according to the variable type (row index for DT, JSON for DR). |
setValue(value) | Promise<void> | Saves a new snapshot value; also accepts API objects (UserApi etc.), which are converted to a primitive value. |
const approvedAmount = snaps['RequestedAmount'].getValue();dr – bulk operations on Dynamic Rows
The dr object (unlike the script inside a Dynamic Rows variable itself, see Dynamic Rows: script) is used to modify the rows of a DR variable directly from the task code.
| Method | Returns | Description |
|---|---|---|
from(variable) | this | Selects the DR variable to work with (a vars['...'] object or its name). |
get() | object | Current DR data. |
removeWhereCol(colName, value) | this | Removes all rows where the colName column contains value. You must call store() to save. |
store() | Promise<this> | Saves the changes back to the variable. |
// Odebere položky objednávky s nulovým množstvím
await dr.from(vars['Items']).removeWhereCol('quantity', 0).store();Related: How and when calculations run, Calculations API reference: lib library, Dynamic Tables in calculations, Calculations on a task.