Skip to content

General ​

Cloud Flow Blocks reference.

Blocks ​

Add to List Contents of List ​

Block name: merge_array

Creates a new list by concatenating the contents of one list with the contents of another list.

Inputs ​

InputTypeDescriptionAccepts
listarrayThe first list to include in the merged result.
contents of listarrayThe second list whose items should be appended to the first list.

Output ​

This block produces an output value of type Array.

Behavior ​

Generates code that concatenates two lists using JavaScript array concat(...).

  • lists_create_with
  • lists_repeat
  • lists_split
  • lists_sort
  • math_on_list

Add to or Subtract from Date ​

Block name: dateaddsub

Adds or subtracts a quantity of time from the selected date. This block updates the connected date value in place.

Inputs ​

InputTypeDescriptionAccepts
operationchoiceWhether to add to or subtract from the date.
datedateThe date value to update. This is typically provided by a date block, but dateclone can be used first if you want to preserve the original date.date
quantitynumberThe amount of time to add or subtract. This is typically provided by a math_number block.math_number
unitschoiceThe time unit for the quantity.

Output ​

This block does not produce an output value.

Behavior ​

Generates code that updates the selected ioLoop date object in place by adding or subtracting the given quantity of time. In JavaScript, ioLoop date values can be converted to and from Moment objects using $io.system.momentObjectFromIoLoopDate and $io.system.ioLoopDateFromMomentObject.

Calls: TvWaDate.add, TvWaDate.subtract

Boolean ( value ) ​

Block name: parse_boolean

Converts a value into a boolean using the ioLoop application's boolean parsing rules.

Inputs ​

InputTypeDescriptionAccepts
valueobjectThe value to convert to a boolean.

Output ​

This block produces an output value of type Boolean.

Behavior ​

Generates code that converts a value to boolean using the ioLoop application helper.

Calls: tvAppInstance.parseBoolean

  • logic_boolean
  • logic_negate
  • logic_compare
  • controls_if

Compare Dates ​

Block name: datecompare

Compares one date value with another date value.

Inputs ​

InputTypeDescriptionAccepts
datedateThe date value to compare. This is typically provided by a date block, but other date-producing blocks such as datefromstring can also be used.date
comparisonchoiceThe comparison to perform.
reference datedateThe date value to compare against. This is typically provided by another date block.date

Output ​

This block produces an output value of type Boolean.

Behavior ​

Generates code that compares two ioLoop date objects using the selected comparison mode. In JavaScript, ioLoop date values can be converted to and from Moment objects using $io.system.momentObjectFromIoLoopDate and $io.system.ioLoopDateFromMomentObject.

Calls: TvWaDate.isBefore, TvWaDate.isSameOrBefore, TvWaDate.isAfter, TvWaDate.isSameOrAfter, TvWaDate.isSame

Complete Deferred Task ​

Block name: promiseresolve

Completes the current deferred task with a result value.

Inputs ​

InputTypeDescriptionAccepts
resultobjectThe value to return when the deferred task completes.

Output ​

This block does not produce an output value.

Behavior ​

Generates code that calls the internal Promise resolver when it is available. This is intended to be used inside the statement area of a promisecreate block, where the resolver is in scope.

Create Deferred Task ​

Block name: promisecreate

Creates a deferred task as a Promise and runs the nested statements inside that Promise.

Inputs ​

InputTypeDescriptionAccepts
dostatementsThe statements to run inside the deferred task. Use the promiseresolve block inside this area to complete the deferred task with a result. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.

Output ​

This block produces an output value of type Promise.

Behavior ​

Generates a JavaScript Promise and runs the nested statements inside its executor function. The nested blocks are emitted inside async function(tvwa_promise_resolve, tvwa_promise_reject) { ... }; the generated body also defines resolve as an alias for tvwa_promise_resolve and reject as an alias for tvwa_promise_reject, so customcode and customcodeexpr blocks inside the deferred task can access those in-scope variables directly.

Current User ​

Block name: current_user_name

Gets the current user's name or identifier from the runtime context.

Output ​

This block produces an output value of type String.

Behavior ​

Generates code that reads the current user from the application runtime. When a webhook request context is available, that request context is passed through to the lookup.

Calls: tvAppInstance.getCurrentUser

Current User is in Group and Role ​

Block name: query_user_group

Checks whether the current user belongs to the selected group at the selected role level.

Inputs ​

InputTypeDescriptionAccepts
groupnumberThe user group to check. This is typically provided by a user_group_sel block.user_group_sel
rolenumberThe role level to check within the selected group. This is typically provided by a user_role_sel block.user_role_sel

Output ​

This block produces an output value of type Boolean.

Behavior ​

Generates code that queries group membership for the current user through the application runtime. When a webhook request context is available, that request context is passed through to the lookup.

Calls: tvAppInstance.queryGroupMembership

Date ​

Block name: date

Creates a new date value for either the current moment or the current day.

Inputs ​

InputTypeDescriptionAccepts
typechoiceWhether to create a date for the current moment or the current day.

Output ​

This block produces an output value of type TvWaDate.

Behavior ​

Generates a new ioLoop date object for either the current moment or the current day. In JavaScript, ioLoop date values can be converted to and from Moment objects using $io.system.momentObjectFromIoLoopDate and $io.system.ioLoopDateFromMomentObject.

Calls: tvAppInstance.dateNow, tvAppInstance.dateToday

Date from Text ​

Block name: datefromstring

Creates a date value by parsing a text string using the provided format.

Inputs ​

InputTypeDescriptionAccepts
textstringThe text to parse into a date. This is typically provided by a text block.text
formatstringThe format string used to parse the date text.

Output ​

This block produces an output value of type TvWaDate.

Behavior ​

Generates a new ioLoop date object by parsing a text value with the provided format string. In JavaScript, ioLoop date values can be converted to and from Moment objects using $io.system.momentObjectFromIoLoopDate and $io.system.ioLoopDateFromMomentObject.

Calls: tvAppInstance.dateFromString

Date is in a Leap Year ​

Block name: dateisleapyear

Checks whether the selected date falls within a leap year.

Inputs ​

InputTypeDescriptionAccepts
datedateThe date value to inspect. This is typically provided by a date block.date

Output ​

This block produces an output value of type Boolean.

Behavior ​

Generates code that checks whether the selected ioLoop date object falls in a leap year. In JavaScript, ioLoop date values can be converted to and from Moment objects using $io.system.momentObjectFromIoLoopDate and $io.system.ioLoopDateFromMomentObject.

Calls: TvWaDate.isLeapYear

Date is in DST ​

Block name: dateisdst

Checks whether the selected date falls within daylight saving time.

Inputs ​

InputTypeDescriptionAccepts
datedateThe date value to inspect. This is typically provided by a date block.date

Output ​

This block produces an output value of type Boolean.

Behavior ​

Generates code that checks whether the selected ioLoop date object falls in daylight saving time. In JavaScript, ioLoop date values can be converted to and from Moment objects using $io.system.momentObjectFromIoLoopDate and $io.system.ioLoopDateFromMomentObject.

Calls: TvWaDate.isDST

Days in Month for Date ​

Block name: datedaysinmonth

Gets the number of days in the month of the selected date value.

Inputs ​

InputTypeDescriptionAccepts
datedateThe date value whose month should be inspected. This is typically provided by a date block.date

Output ​

This block produces an output value of type Number.

Behavior ​

Generates code that reads the number of days in the month of the selected ioLoop date object. In JavaScript, ioLoop date values can be converted to and from Moment objects using $io.system.momentObjectFromIoLoopDate and $io.system.ioLoopDateFromMomentObject.

Calls: TvWaDate.daysInMonth

Difference Between Dates ​

Block name: datediff

Gets the difference between two date values in the selected time unit.

Inputs ​

InputTypeDescriptionAccepts
unitschoiceThe time unit to use for the difference result.
datedateThe first date value. This is typically provided by a date block.date
reference datedateThe second date value to compare against. This is typically provided by another date block.date

Output ​

This block produces an output value of type Number.

Behavior ​

Generates code that calculates the difference between two ioLoop date objects in the selected time unit. In JavaScript, ioLoop date values can be converted to and from Moment objects using $io.system.momentObjectFromIoLoopDate and $io.system.ioLoopDateFromMomentObject.

Calls: TvWaDate.diff

Exit Function ​

Block name: function_return

Exits the current function without returning a value.

Output ​

This block does not produce an output value.

Behavior ​

Generates a plain JavaScript return; statement. This is only meaningful inside a generated function body or another context where a return statement is valid.

Exit Function and Return ​

Block name: function_return_value

Exits the current function and returns a value.

Inputs ​

InputTypeDescriptionAccepts
return valueobjectThe value to return from the current function.

Output ​

This block does not produce an output value.

Behavior ​

Generates a plain JavaScript return <value>; statement. This is only meaningful inside a generated function body or another context where a return statement is valid.

Find Pattern in Text ​

Block name: regexp_match

Finds matches for a regular expression pattern within a text value.

Inputs ​

InputTypeDescriptionAccepts
textstringThe text to search.
patternstringThe regular expression pattern to find. This is typically provided by a text block.text
optionsstringThe regular expression flags such as i or ig. This is typically provided by a text block.text

Output ​

This block produces an output value of type Array.

Behavior ​

Generates a JavaScript match(new RegExp(...)) expression for the selected text value.

Flow Start ​

Block name: flow_start

Marks the recommended starting point for a Page Flow or Cloud Flow. This block is guidance for organizing a workspace; blocks do not have to be connected below it to run.

Output ​

This block does not produce an output value.

Behavior ​

Generates no runtime operation of its own. It is a label-only starter block with a bottom connector for optional organization.

Generate JSON ​

Block name: genjson

Converts an object or other value into a JSON text string.

Inputs ​

InputTypeDescriptionAccepts
objectobjectThe value to convert into JSON text. This can be any block that returns an object or compatible value, such as define_object, emptyobject, formdataobject, data_record_object, httpdata, apicalldata, or tvexportobject.

Output ​

This block produces an output value of type String.

Behavior ​

Generates code that converts a value into a JSON string through the ioLoop system runtime.

Calls: $io.system.generateJson

Get Date Property ​

Block name: getdateprop

Gets a numeric property from a date value.

Inputs ​

InputTypeDescriptionAccepts
propertychoiceThe date property to read.
datedateThe date value to read from. This is typically provided by a date block, but other date-producing blocks such as datefromstring can also be used.date

Output ​

This block produces an output value of type Number.

Behavior ​

Generates code that reads a numeric property from the selected ioLoop date object. In JavaScript, ioLoop date values can be converted to and from Moment objects using $io.system.momentObjectFromIoLoopDate and $io.system.ioLoopDateFromMomentObject.

Calls: TvWaDate.year, TvWaDate.month, TvWaDate.dayOfMonth, TvWaDate.hours, TvWaDate.minutes, TvWaDate.seconds, TvWaDate.dayOfWeek

is a Valid Number ​

Block name: checknan

Checks whether a value can be treated as a valid number.

Inputs ​

InputTypeDescriptionAccepts
valueobjectThe value to test.

Output ​

This block produces an output value of type Boolean.

Behavior ​

Generates a JavaScript isNaN check for the selected value and returns true when the value is a valid number.

Log Category ​

Block name: log_cat

Provides a predefined logging category string for use with logging blocks.

Inputs ​

InputTypeDescriptionAccepts
categorychoiceThe predefined logging category to use.

Output ​

This block produces an output value of type String.

Behavior ​

Generates the selected predefined logging category string.

Move Date to Start or End Of ​

Block name: datestartendof

Moves the selected date to the start or end of the chosen time unit. This block updates the connected date value in place.

Inputs ​

InputTypeDescriptionAccepts
datedateThe date value to update. This is typically provided by a date block, but dateclone can be used first if you want to preserve the original date.date
operationchoiceWhether to move the date to the start or end of the chosen unit.
unitchoiceThe time unit to align the date to.

Output ​

This block does not produce an output value.

Behavior ​

Generates code that updates the selected ioLoop date object in place to the start or end of the chosen time unit. In JavaScript, ioLoop date values can be converted to and from Moment objects using $io.system.momentObjectFromIoLoopDate and $io.system.ioLoopDateFromMomentObject.

Calls: TvWaDate.startOf, TvWaDate.endOf

Move Date to Weekday ​

Block name: dateweekday

Moves the selected date to the chosen weekday. This block updates the connected date value in place.

Inputs ​

InputTypeDescriptionAccepts
datedateThe date value to update. This is typically provided by a date block, but dateclone can be used first if you want to preserve the original date.date
weekdaychoiceThe weekday to move the date to.

Output ​

This block does not produce an output value.

Behavior ​

Generates code that updates the selected ioLoop date object in place to the chosen weekday. In JavaScript, ioLoop date values can be converted to and from Moment objects using $io.system.momentObjectFromIoLoopDate and $io.system.ioLoopDateFromMomentObject.

Calls: TvWaDate.dayOfWeek

New Date from ​

Block name: dateclone

Creates a copy of an existing date value.

Inputs ​

InputTypeDescriptionAccepts
datedateThe date value to copy. This is typically provided by a date block, but other date-producing blocks such as datefromstring can also be used.date

Output ​

This block produces an output value of type TvWaDate.

Behavior ​

Generates a clone of the selected ioLoop date object. In JavaScript, ioLoop date values can be converted to and from Moment objects using $io.system.momentObjectFromIoLoopDate and $io.system.ioLoopDateFromMomentObject.

Calls: TvWaDate.clone

Number ( value ) ​

Block name: converttonumber

Converts a value to a number.

Inputs ​

InputTypeDescriptionAccepts
valueobjectThe value to convert to a number.

Output ​

This block produces an output value of type Number.

Behavior ​

Generates a JavaScript number conversion using Number(...) and falls back to null when no value is connected.

  • math_number
  • math_arithmetic
  • checknan
  • converttotext

Object ​

Block name: getvariablebyname

Gets a variable or object by name from the current script context.

Inputs ​

InputTypeDescriptionAccepts
namestringThe variable or object name to read.

Output ​

This block produces an output value of type Any.

Behavior ​

Generates an expression that reads a named variable from the current script scope and returns null when it is not defined.

Object from JSON ​

Block name: jsonparse

Parses a JSON text string into an object, array, or other JSON value.

Inputs ​

InputTypeDescriptionAccepts
JSONstringThe JSON text to parse. This is typically provided by a text block.text

Output ​

This block produces an output value of type Any.

Behavior ​

Generates code that parses a JSON string through the ioLoop system runtime.

Calls: $io.system.jsonParse

Replace Pattern in Text ​

Block name: regexp_replace

Replaces text that matches a regular expression pattern and returns the updated text.

Inputs ​

InputTypeDescriptionAccepts
textstringThe text to update.
patternstringThe regular expression pattern to replace. This is typically provided by a text block.text
optionsstringThe regular expression flags such as i or ig. This is typically provided by a text block.text
replacement textstringThe text to insert for each match. This is typically provided by a text block.text

Output ​

This block produces an output value of type Boolean.

Behavior ​

Generates a JavaScript replace(new RegExp(...), ...) expression for the selected text value.

Set Date Property ​

Block name: setdateprop

Sets a numeric property on a date value. This block updates the connected date value in place.

Inputs ​

InputTypeDescriptionAccepts
propertychoiceThe date property to update.
datedateThe date value to update. This is typically provided by a date block, but dateclone can be used first if you want to preserve the original date.date
valuenumberThe new numeric value for the selected property. This is typically provided by a math_number block.math_number

Output ​

This block does not produce an output value.

Behavior ​

Generates code that updates a numeric property on the selected ioLoop date object in place. In JavaScript, ioLoop date values can be converted to and from Moment objects using $io.system.momentObjectFromIoLoopDate and $io.system.ioLoopDateFromMomentObject.

Calls: TvWaDate.year, TvWaDate.month, TvWaDate.dayOfMonth, TvWaDate.hours, TvWaDate.minutes, TvWaDate.seconds

Test or Preview Mode ​

Block name: is_test_mode

Checks whether the current runtime is running in test mode or preview mode.

Output ​

This block produces an output value of type Boolean.

Behavior ​

Generates code that queries the ioLoop system runtime for the current test or preview mode state.

Calls: $io.system.isTestMode

Text Ends With ​

Block name: string_endswith

Checks whether a text value ends with another text value.

Inputs ​

InputTypeDescriptionAccepts
textstringThe text to inspect.
patternstringThe ending text to look for. This is typically provided by a text block.text

Output ​

This block produces an output value of type Boolean.

Behavior ​

Generates a JavaScript endsWith(...) expression for the selected text value.

Text from Date ​

Block name: datetostring

Formats a date value as text using the provided format string.

Inputs ​

InputTypeDescriptionAccepts
datedateThe date value to format. This is typically provided by a date block, but other date-producing blocks such as datefromstring can also be used.date
formatstringThe format string used to convert the date to text.

Output ​

This block produces an output value of type String.

Behavior ​

Generates code that formats the selected ioLoop date object as text. In JavaScript, ioLoop date values can be converted to and from Moment objects using $io.system.momentObjectFromIoLoopDate and $io.system.ioLoopDateFromMomentObject.

Calls: TvWaDate.toString2

Text Matches Pattern ​

Block name: regexp_test

Checks whether a text value matches a regular expression pattern.

Inputs ​

InputTypeDescriptionAccepts
textstringThe text to test.
patternstringThe regular expression pattern. This is typically provided by a text block.text
optionsstringThe regular expression flags such as i or ig. This is typically provided by a text block.text

Output ​

This block produces an output value of type Boolean.

Behavior ​

Generates a JavaScript RegExp(...).test(...) expression using the selected pattern and flags.

Text Starts With ​

Block name: string_startswith

Checks whether a text value starts with another text value.

Inputs ​

InputTypeDescriptionAccepts
textstringThe text to inspect.
patternstringThe starting text to look for. This is typically provided by a text block.text

Output ​

This block produces an output value of type Boolean.

Behavior ​

Generates a JavaScript startsWith(...) expression for the selected text value.

Timer: After ​

Block name: srv_rearmabletimer

Schedules a server-side timer that runs the nested statements after the specified delay.

Inputs ​

InputTypeDescriptionAccepts
durationnumberThe amount of time to wait before the timer callback runs. This is typically provided by a math_number block.math_number
unitschoiceThe time unit for the delay.
dostatementsThe statements to run when the timer fires. Inside this block, srv_rearmtimer can be used to arm the same timer again for another cycle. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.

Output ​

This block does not produce an output value.

Behavior ​

Generates server-side code that creates a timer through $io.system.createTimer. The nested blocks are emitted inside function(timerObj, infoObj) { ... }, so customcode and customcodeexpr blocks inside the timer callback can access timerObj and infoObj directly. The selected units are passed into $io.system.createTimer(...).

Calls: $io.system.createTimer

Timer: Repeat ​

Block name: srv_rearmtimer

Re-arms the current timer so it runs again after its configured interval.

Output ​

This block does not produce an output value.

Behavior ​

Generates server-side code that re-arms the current timer object when timerObj is available in the active timer callback context. At runtime, $io.system.reArmTimer(timerObj) calls timerObj.arm() on that timer instance.

Calls: $io.system.reArmTimer

User Group ​

Block name: user_group_sel

Provides a predefined user group identifier.

Inputs ​

InputTypeDescriptionAccepts
groupchoiceThe predefined user group to use.

Output ​

This block produces an output value of type Number.

Behavior ​

Generates the numeric identifier of the selected predefined user group for use in shared user-membership checks.

User Role ​

Block name: user_role_sel

Provides a predefined user role level identifier.

Inputs ​

InputTypeDescriptionAccepts
rolechoiceThe predefined user role level to use.

Output ​

This block produces an output value of type Number.

Behavior ​

Generates the numeric identifier of the selected predefined user role level for use in shared user-membership checks.

Wait for Multiple Deferred Tasks Completion ​

Block name: promisecombine

Combines multiple deferred tasks into a single Promise using either all or any mode.

Inputs ​

InputTypeDescriptionAccepts
modechoiceHow the deferred tasks should be combined.
deferred tasksarrayThe list of Promises or deferred tasks to combine. This is typically provided by a list block containing Promise values.

Output ​

This block produces an output value of type Promise.

Behavior ​

Generates either Promise.all(...) or Promise.any(...) for the selected list of deferred tasks, depending on the chosen mode.

Wait on Deferred Task Completion ​

Block name: promiseawait

Waits for a deferred task to complete before continuing. This block emits a direct await statement, so it must be used inside an async context such as the then do area of a promisethen block.

Inputs ​

InputTypeDescriptionAccepts
deferred taskpromiseThe Promise or deferred task to wait on. This is typically provided by a promisecreate block or another block that returns a Promise.promisecreate

Output ​

This block does not produce an output value.

Behavior ​

Generates a bare JavaScript await <promise>; statement. Because it emits direct await code, it requires an async context such as the callback generated by promisethen.

Wait on Deferred Task Completion ​

Block name: promiseawaitret

Waits for a deferred task to complete and returns its resolved value. This block emits a direct await expression, so it must be used inside an async context such as the then do area of a promisethen block.

Inputs ​

InputTypeDescriptionAccepts
deferred taskpromiseThe Promise or deferred task to wait on. This is typically provided by a promisecreate block or another block that returns a Promise.promisecreate

Output ​

This block produces an output value of type Any.

Behavior ​

Generates a JavaScript (await <promise>) expression. Because it emits direct await code, it requires an async context such as the callback generated by promisethen.

Wait on Deferred Task to Complete and Then Do ​

Block name: promisethen

Waits for a deferred task to complete and then runs the nested statements. The nested then do area runs in an async function, so other deferred tasks can be awaited directly inside it.

Inputs ​

InputTypeDescriptionAccepts
deferred taskpromiseThe Promise or deferred task to wait on. This is typically provided by a promisecreate block or another block that returns a Promise.promisecreate
then dostatementsThe statements to run after the deferred task completes. Inside this area, the promiseresult block provides the resolved value of the deferred task, and other deferred tasks can be awaited directly with blocks such as promiseawait or promiseawaitret because this callback is generated as an async function. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.

Output ​

This block does not produce an output value.

Behavior ​

Generates a Promise.resolve(...).then(async function(tvwaPromiseResult) { ... }) wrapper and runs the nested statements after the Promise resolves. The resolved value is exposed inside that callback through tvwaPromiseResult, so customcode and customcodeexpr blocks inside the completion callback can access tvwaPromiseResult directly. The async callback means nested blocks can emit direct await expressions safely.

Write Log Message ​

Block name: log_msg_str

Writes a message to the runtime log output or ioLoop cloud logs.

Inputs ​

InputTypeDescriptionAccepts
messagestringThe message to write to the log. This is typically provided by a text block.text
categorystringAn optional log category such as info, error, or warning.
levelnumberAn optional log level number.

Output ​

This block does not produce an output value.

Behavior ​

Generates code that writes the provided message, category, and level through the ioLoop system logging runtime.

Calls: $io.system.log