with( local!startIndex: 1+ (ri!index*cons!EXPORT_TO_EXCEL_BATCH_SIZE), local!pagingInfo: a!pagingInfo( startIndex: local!startIndex, batchSize: cons!EXPORT_TO_EXCEL_BATCH_SIZE ), /*This rule queryEntityRule2 should be your actual query which will pull data for export to excel */ rule!queryEntityRule2( pageInfo: local!pagingInfo ).data )