'Returns data with same code in Apps Script

I have the following code, when I enter the code on telegram bot, telegram will display the information corresponding to that code in Spreadsheets, but it only displays 1 line, the rest of the same code lines are not displayed . Please help me.

var token = "x";
var SheetID = "x";


function doPost(e) {
  var stringJson = e.postData.getDataAsString();
  var updates = JSON.parse(stringJson);
 
    if(updates.message.text){
      sendText(updates.message.chat.id,CariBarangDariIDSheet(updates.message.text)); 
    }
}

   
function AmbilSheet2(){
  var rangeName = 'Sheet2!A2:C';
  var rows = Sheets.Spreadsheets.Values.get(SheetID, rangeName).values;
  return rows;
}


function CariBarangDariIDSheet(IDbarang){
 var dataBarang = AmbilSheet2(); 
  for (var row = 0; row < dataBarang.length; row++) {
    if(dataBarang[row][0]==IDbarang){ 
      return 
            "CODE : " + dataBarang[row][0] + "\n" +
            "Name : " + dataBarang[row][1] + "\n" +
            "Date : " + dataBarang[row][2];             
    }
  } 
  }

function sendText(chatid,text,replymarkup){
var data = {
    method: "post",
    payload: {
      method: "sendMessage",
      chat_id: String(chatid),
      text: text,
      parse_mode: "HTML",
      reply_markup: JSON.stringify(replymarkup)
    }
  };
  UrlFetchApp.fetch('https://api.telegram.org/bot' + token + '/', data);
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source