Row()

Returns a row from a rowset, array, or object.

Availability 

Marketing Cloud Engagement ✅ Yes
Marketing Cloud Next ✅ Yes

This function became available in Marketing Cloud Next during the Summer ’26 release (API version 67.0).

Syntax 

1Row(rowset, rowPosition)

The Row() function has two parameters:

  • rowset (string): Required. The rowset, array, or object to return a row from.
  • rowPosition (string): Required. The row number to return. The first row is row 1.

Usage 

To use the function, pass it a rowset, and the row number that you want to return. This example sets the value of @row to the first row of the rowset contained in the @rowset variable.

1%%[
2  Set @row = Row(@rowset, 1)
3]%%

You can combine the Row() function with the Field() function to output a specific piece of data from the specified row. This example creates a rowset from JSON data. The Row() function retrieves the first row from the rowset. The Field() function retrieves the value of the “Price” attribute from the first row.

1%%[
2  Set @json = '
3  {
4    "Flights": [
5      {
6        "Origin": "IND",
7        "Dest": "NYC",
8        "Price": 100.0,
9        "PerBagSurcharge": "N/A"
10      },
11      {
12        "Origin": "IND",
13        "Dest": "LAX",
14        "Price": 200.0,
15        "PerBagSurcharge": "Free"
16      },
17      {
18        "Origin": "IND",
19        "Dest": "SEA",
20        "Price": 500.0,
21        "PerBagSurcharge": 25
22      }
23    ]
24  }'
25  Set @rowset = BuildRowsetFromJSON(@json, "$.['Flights'][*]", true)
26  Set @row = Row(@rowset, 1)
27  Set @field = Field(@row, "Price", 0)
28  Output(v(@field))
29]%%

The function outputs 100.