GetTransactionData return issue

Why does GetTransactionData sometimes return nothing even when excel has rows??
Thanks for the help.

Hi, @Aarya_singh

Beacuse Your TransactionNumber exceed Rows.Count Always ensure

TransctionNumber <=dt_input.ROws.Count

otherwise REFramework assumes completion

3 Likes

Hi :waving_hand:@Aarya_singh

The DataTable is empty or not properly assigned in Init and passes to GetTransactionData

In REF, GetTransactionData may return Nothing even when Excel has data because the framework processes rows using a transaction counter. If the TransactionNumber becomes greater than the total number of rows, it will return Nothing. This can also happen if the Excel data wasn’t loaded correctly due to wrong sheet, header mismatch, empty rows or if rows were filtered/removed earlier.

Log TransactionNumber and DataTable.Rows.Count.
If TransactionNumber > Rows.Count, the behavior is expected.

Very important to note:
TransactionNumber is 1-based, while DataTable rows are 0-based, so correct indexing is important…

If in_TransactionNumber <=dt_TransactionData.Rows.Count Then
out_TransactionItem =dt_TransactionData(in_TransactionNumber - 1)
Else
out_TransactionItem = Nothing
End If

Hi @Aarya_singh

GetTransactionData returns Nothing when no transaction is available for the current state, even if the Excel file still has rows. This usually happens due to one of the following:
InitTransactionData did not load the data correctly - Excel not read or DataTable empty at runtime
TransactionNumber has exceeded dt.Rows.Count.
Transactions were already marked as Successful/Failed and not reset.
The DataTable is being re-initialized or cleared between states.
Filters (Select / Assign) removed rows before processing.

Add logs to check dt.Rows.Count and TransactionNumber value

Hope this solution works for you

Cheers

Hi @Aarya_singh,

GetTransactionData returns nothing when the transaction number is greater than the number of rows in the Excel DataTable, or when the DataTable is empty or not correctly shared across the framework. This often happens if the table is not stored properly from Init or if the transaction index is being incremented incorrectly.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.