Loading

Error returns for an email or Triggered Send: 'Invalid index (parameter 2) passed to Row function. Index must be less than or equal to the row count'

Дата публикации: Sep 25, 2025
Описание

The following error may appear when you send an email or use Triggered Send but don't receive an email:

 

Full error message text:

MachineName: MAIL010101 MemberID: 12345678 JobID: 654321 OMMSlotID 44433322266 ExactTarget.OMM.FunctionExecutionException: Invalid index (parameter 2) passed to Row function. Index must be less than or equal to the row count. Index Value: 1 Row Count: 0 Function: Row(BuildRowsetFromXML(XML,"//URL"),1) Error Code: OMM_FUNC_EXEC_ERROR - from OMMCommon

 

Root cause

In AMPscript, an empty rowset was passed to the Row function. Since row parameter passed cannot be null the operation failed.

Решение

To resolve the error, write more AMPscript to includes a ROWCOUNT function and instruct the system what to do when it encounters an empty or NULL value.

 

AMPScript logic


1. Perform the row count.
2. If row count is greater than 0, retrieve a value from the data extension.
3. If the value from the data extension is not NULL, send to subscriber. However, if the value from the data extension is NULL, call the 'raiseerror' function.

 

Example problem code

%%[
var @rowset, @row
/*the below Rowset returns no rows*/
set @rowset = LookupRows('Target_DataExtension','Value_to_Return','Value_Does_Not_Exist')
/*the below Row function looks for the first row but does not exist*/
set @row = Row(@rowset,1) 
]%%

Example Solution

%%[
var @rowset, @row

set @rowset = LookupRows('Target_DataExtension','Value_to_Return','Value_to_Search')

if RowCount(@rowset)> 0 then

/*if there are rows present then return the first row*/

set @row = Row(@rowset,1) 

else then

/* do something else */

endif

]%%


If this is a Triggered Send, once you've made these changes, you'll want to pause, republish and restart it.

Номер статьи базы знаний

000388006

 
Загрузка
Salesforce Help | Article