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
- Form condition /
- Dynamic Rows: Script
Dynamic Rows: Script
Besides the JSON column definition (see Variables: Dynamic Rows), a Dynamic Rows variable has its own Script. This is JavaScript code that runs in the user's browser and controls the values, appearance and behaviour of table cells while the form is in use. This article is a reference of the script methods and context in TAS 5.19.12.
Script context
In the code, the context of the current task is available under this.currentTask: this.currentTask.id (task ID), this.currentTask.items (task variables with their initial values from the database), this.currentTask.refs (references to form components) and this.currentTask.processVars (case variables). The current table data is under this.table, and the current form language is in this.language. The this.props.formIsPristine flag, or t['sloupec'][i].isPristine() (where i is the row number), tells you whether the user has changed the form or the cell since it was loaded. this.lastChangedCell refers to the cell the user changed most recently. The Lodash library is available for general helper functions.
In all methods below, t is the table context (a reference to all cells, t['sloupec'][i]) and i/rowNumber is the row number. If colName/rowNumber is null, the function applies to the whole column or the whole row.
this.value – cell value
this.value(colName, rowNumber, args);| Parameter | Description |
|---|---|
colName | Column name; null = all columns of the row. |
rowNumber | Row number; null = all rows of the column. |
args | A value, or a function function(t, i, original) that returns the value. original is the original value of the cell. |
this.value('totalPrice', null, function(t, i) {
return t['unitPrice'][i].getValue() * t['quantity'][i].getValue();
});
// Součtový řádek (řádek 1 bývá totals)
this.value('totalPrice-total', 1, function(t, rows) {
var total = 0;
for (var i in rows) {
total += t['totalPrice'][i].getValue();
}
return total;
});this.task – cell style
this.task(colName, rowNumber, args);The parameters are the same as for this.value, but args returns an object with CSS styles.
this.task('totalPrice', null, function(t, i) {
return t['totalPrice'][i].getValue() > 10000
? { textAlign: 'right', color: '#c00' }
: { textAlign: 'right', color: '#555' };
});this.changeDef – table and column definition
this.changeDef(newDef);newDef is an object {colName: {vlastnost: hodnota}, ..., table: {...}}. The table key changes properties of the whole table, e.g. side, showAddRemove, showTotals. Properties accumulate, so if you want to hide a column only when a condition is met, you must make it visible again in the opposite branch. Multiple changeDef calls are merged. If several calls return the same property, the value returned last applies.
this.changeDef(function() {
return {
totalPrice: { duty: 'readonly' },
note: { isVisible: vSync('OrderType') === 'Goods' },
table: { side: 'left', showTotals: false },
};
});this.changeCell – cell properties
this.changeCell(colName, rowNumber, args);The parameters are the same as for this.value. args returns an object with the properties of a specific cell, e.g. duty, isValid, validationErrors, or the data source for DL/DT: dataUrl, urlFilter, colIndex.
this.changeCell('totalWithVat', null, function(t, i) {
return t['totalPrice'][i].getValue() || t['totalPrice'][i].getValue() === 0
? { duty: 'mandatory' }
: { duty: 'writeable' };
});
// Změní zdroj dat našeptávače podle zvoleného kraje
this.changeCell('city', null, function(t, i) {
var region = t['region'][i].getValue() && t['region'][i].getValue().value;
if (region) {
return { colIndex: 2, dataUrl: '/dyn-table/52/values', urlFilter: 'col_1<eq>' + region };
}
});Other methods
| Method | Signature | Description |
|---|---|---|
this.changeFormComponents | (componentName, value) | Sets the value of another variable on the task form (outside the table). componentName is the variable name and value is the new value or a function. |
this.formComponentsStyle | (componentName, style) | Sets the style of another form variable, typically to hide it: this.formComponentsStyle('Sequence', {display: 'none'}). |
this.insertHtml | (html) | Inserts custom HTML below the table, e.g. total fields outside the table columns. |
this.valueHtml | (id, value) | Sets the value of an inserted HTML element by its id. |
this.getDynTable | (dt_id, dtc_id) | Loads column dtc_id of dynamic table dt_id (you can also use the table name) into this.dynTable[dt_id]. It is asynchronous, so the script waits for it to finish. |
this.deleteRow | (args) | Deletes a row. args is a boolean, or a function function(t, rowId) that returns true/false. |
this.handleErrors | (error) | Writes an error from try/catch or a rejected promise to the console and prevents the task from being completed while the error persists. |
this.insertHtml('<div><span>Celkem s DPH</span><input id="totalSum" type="text" readonly></div>');
this.valueHtml('totalSum', function(t) {
return numeral(t['totalWithVat-total'][1].getValue()).format('0,0.00 $');
});
this.getDynTable('Suppliers');
this.value('supplierVat', null, function(t, i) {
var row = t['supplier'][i].getValue();
if (!row) return null;
var found = _.find(this.dynTable['Suppliers'], { dtv_index: row.value });
return found ? found.col_4 : null;
});For a column to react to changes of a form variable outside the table, the variable must be listed in
table.watchVariables in the table definition and must be mapped as writable in the task. Otherwise the script is not recalculated when that variable changes. For a full list of definition properties, see the article Variables: Dynamic Rows.Snippets
The Insert snippet button in the script editor offers ready-made call templates for the methods above (this.value, this.task, this.changeDef, this.changeCell, this.changeFormComponents, this.formComponentsStyle, this.insertHtml/this.valueHtml, this.getDynTable, this.deleteRow, this.handleErrors). The template is inserted at the cursor position, and you only need to fill in the column names and the logic.
Related: Variables: Dynamic Rows, Dynamic Conditions: Script, Dynamic Table API.