Notification

AppSheet will be conducting service maintenance starting Sunday, May 19th, 2024 at 12:00 PM (7:00 PM UTC) and completing no later than 4:00 PM PDT (11:00 PM UTC). Learn more

REF_ROWS()

Gather related rows from table or slice

Returns a list of key column values from rows in the specified table or slice in which the specified Ref-type column refers to this row (the row from which the REF_ROWS() expression is evaluated).

Answers the question: which rows in dataset refer to this row from ref-column?

Sample usage

REF_ROWS("Order Details", "Order ID") gives a list of rows from the Order Details table whose Order ID column value matches this row's key column value, where "this row" is the row from which the REF_ROWS() expression is evaluated.

REF_ROWS("Order Details", "Order ID") is functionally equivalent to each of the following:

  • FILTER("Order Details", ([_THISROW] = [Order ID]))
  • SELECT(Order Details[Order Details ID], ([_THISROW] = [Order ID])).

Syntax

REF_ROWS(dataset, ref-column)

  • dataset - Name of the table or slice (the "data set") in which related rows are to be found.
  • ref-column - Name of a column in the data set named by dataset that contains Ref-type values.
Note: Both arguments must be raw text values (quoted or unquoted) that identify an existing table or slice (dataset) and column (ref-column); they may not be expressions.

Magical Behavior

If a column's App formula consists exclusively of a simple REF_ROWS() expression, a row added from the resulting list's inline view will automatically be populated with a reference back to the row of the REF_ROWS() expression, creating a child-parent relationship. The parent reference will be placed in the column named by the ref-column argument of the REF_ROWS() expression.

See also

FILTER()

LOOKUP()

MAXROW()

MINROW()

ORDERBY()

SELECT()

Was this helpful?

How can we improve it?

Need more help?

Try these next steps:

true
Search
Clear search
Close search
Main menu
13119840623109102118
true
Search Help Center
true
true
true
false
false