0

저는 스프레드 시트에서 선택한 고객을 위해 사용 가능한 데이터를 앱 제작자 양식으로 제시하려고합니다. 직원이 변경하거나 빈 필드를 업데이트하려고 할 때입니다. 클라이언트 측 코드 :업데이트를 위해 스프레드 시트의 고객 데이터를 앱 제조업체의 양식에 어떻게 표시 할 수 있습니까?

function getDetails() { 
    var props = app.currentPage.properties; 
    var page = app.pages.Search; 
    var Channel = app.datasources.Update.items; 
    var Customer = page.descendants.Sheets.value; 
    props.Loading = true; 
    props.Error = null; 
    google.script.run 
    .withFailureHandler(function(error) { 
     props.Loading = false; 
     props.Error = JSON.stringify(error); 

     console.error(error); 
    }) 
    .withSuccessHandler(function(Channel) { 
    props.Loading = false; 
    page.Channel = Channel; 
    var items = []; 
    items = getChannels(props.SelectedSheet); 
    Channel.items.load(); // this line dosen't work and it doesn't load the data into form 
     if (Channel && Channel.length > 0) { 
     page.SelectedSheet = Channel[0]; 
     } }) 
    .getDetails(props.SelectedSheet); 
} 

서버 측 코드 :

function getDetails()(customer){ 
    var spreadSheet = SpreadsheetApp.openById("***").getSheetByName('TRACKER'); 
    var data=spreadSheet.getDataRange().getValues(); 
    var channels = []; 
    var Name = customer; 
    var string1 = Name; 
    var array1 = string1.split(";"); // in here I extract row number belong to customer to get data 
    var destrow = []; 
    destrow.push(data[array1[0]][0],data[array1[0]][1],data[array1[0]][2],data[array1[0]][3],data[array1[0]][4],data[array1[0]][5]); 
    channels.push(destrow); 
// return channels; 
    return channels.map(function(Channel){ 
    return Channel;}); // return array of field data to presented in app maker form 
    } 

어떤 대답이나 제안에 감사드립니다. 그것은 당신의 코드에서 명확하지 않다

function getDetails() { 
    ... 
    var Channel = app.datasources.Update.items; 

    ... 
    // your first Channel variable is never used and is overridden with 
    // Channel callback parameter 
    .withSuccessHandler(function(Channel) { 
     // this line does nothing, since all App Maker objects are sealed 
     page.Channel = Channel; 
     // TypeError: load is not a function 
     Channel.items.load(); 
    ... 
    } 

당신이 무엇을하려고 : Channel 배열과 배열 load 방법이 없기 때문에

건배

이론적으로

답변