Skip to main content

forAllCellsByRow

Loops through a row and applies a function to all cell values.

The output is a concatenated string.

The first parameter defines the input row, 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

  • FOCUS ROW (row)

    The input row.

  • FUNCTION (function)

    The function to apply to all cell values in the row.

    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

Note

The first column — ID in the table above — contains the row names.

These examples use a lambda expression to apply the upper function to each cell value in a row.

ATL in Script

Result

[[forAllCellsByRow(rows('2'), x -> upper(x))]]

BOSTONMASSACHUSETTSEMMA MOORE

[[forAllCellsByRow(rows('3'), x -> upper(x))]]

LOS ANGELESCALIFORNIALINDA BARCLAY

To get a list of amended row values, use the map function instead.

ATL in Script

Result

[[map(rows('2'), x -> upper(x))]]

BOSTON, MASSACHUSETTS and EMMA MOORE

[[map(rows('3'), x -> upper(x))]]

LOS ANGELES, CALIFORNIA and LINDA BARCLAY