Is there a method to obtain all non empty data of a column

In spreadsheet API, is there a method to obtain all non empty data of a column

Hello @jiaqi454

Please share whole scenario in which you’d like to get all data from the specified column. Do you want to get data exactly from the cells of specified column or the cells themselves?

for example, in column A,


Someone inputs values through the interface, only A1、A2、A4、A5、A7 has value.The last, I want get the array values like [A1:1,A2:4,A4:6,A5:7,A7:3] in one API.

Hello @jiaqi454
If you don’t mind, I will join this thread too.
It seems you need to use .GetRange and .GetValue methods. The sample of my test:

(function() {
    var oWorksheet = Api.GetActiveSheet();
    var oRange = oWorksheet.GetRange("A1:A15");
    var values = oRange.GetValue(); 
    for (var i = 0; i < values.length; i++) {
        var cellValue = values[i][0]; 
        if (cellValue === "") {
            continue;
        }
        console.log("Cell data " + (i + 1) + ": " + cellValue);
    }
})();