Hi Nancy,
The [](0,1) means row_to_update is an empty list, so there aren't any matching rows in the data table. Since Get Rows Where () returns a list, you might be better served with the different approach in the script below:
names default to here (1);
newContrib = New Table( "newContrib",
Add Rows( 3 ),
New Column( "request_id",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [263496, 263496, 263496] )
),
New Column( "line_no",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [0, 0, 1] )
)
);
row_to_update = newContrib << Get Rows Where(:"request_id" == 263496 & :"line_no" == 0);
//row_to_update is [1,2]
row_to_update = newContrib << Get Rows Where(:"request_id" == 263497 & :"line_no" == 0);
//row_to_update is empty: [](0, 1)
row_to_update = (newContrib << Get Rows Where(:"request_id" == 263496 & :"line_no" == 0))[1];
//row_to_update is 1
//a different approach:
rows_to_update = newContrib << Get Rows Where(:"request_id" == 263496 & :"line_no" == 0);
if (n items(rows_to_update) > 0, row_to_update = rows_to_update[1]);