forAllRows
This function loops through all rows and applies a function to all cell values.
The output is a concatenated string.
The first parameter defines the input table region, and the second defines a function to apply to each cell value. You can write this function as a lambda expression or give the name of a user-defined function.
Note
Available in "Describe the Table" and "Describe Row in Context" projects only.
Parameters
TABLE REGION (table region)
The input table region.
FUNCTION (function)
The function to apply to all cell values.
Write a lambda expression or the name of a user-defined function.
Example
Assume a two-dimensional table project with this data:
ID | Branch | State | Manager | |
---|---|---|---|---|
Row 1 | 1 | Pittsburgh | Pennsylvania | Andrew Gray |
Row 2 | 2 | Boston | Massachusetts | Emma Moore |
Row 3 | 3 | Los Angeles | California | Linda Barclay |
Row 4 | 4 | Chicago | Illinois | Camilla Scott |
In this example, the table region comprises Rows 1–4 for the Branch and Manager columns only. The function loops through the rows, using a lambda expression to apply the lower function to each cell value.
ATL in Script | Result |
---|---|
[[ tableRegion = columns(Branch, Manager) forAllRows(tableRegion, value -> lower(value)) ]] | pittsburgh and andrew grayboston and emma moorelos angeles and linda barclaychicago and camilla scott |