How to create multilevel drop-down list using app script in hindi ?
दोस्तों आज के इस आर्टिक्ल में मै आपको बताउगा की किस तरीके से गूगल शीट में (How to create multilevel drop-down list using app script in hindi ?) अप्पसक्रिप्ट की मदद से आप मल्टीलेवल डिपेंडेंट ड्राप डाउन लिस्ट बना सकते है |
यह भी पढ़े : dependent Dropdown list using appscript in hindi
यह भी पढ़े : how to send offer letter from spreadsheet Data using appscript in hindi
Sheet ko practice ke liye download kare...
let sheet= SpreadsheetApp.getActiveSpreadsheet().getSheetByName('DropDown'); let itemSheet=SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Item Name'); let modelSheet=SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Model'); let colorSheet=SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Color'); function multilevel_Dropdown() { let dropdownRange=sheet.getRange('A2:A10'); let lrow= itemSheet.getRange('A2:A').getValues().filter(String).length+1; let dropVal = itemSheet.getRange('A2:A'+lrow); let rule = SpreadsheetApp.newDataValidation() .requireValueInRange(dropVal) .build(); dropdownRange.setDataValidation(rule); } function dependentDropDown(){ let model = modelSheet.getRange('A1:E1').getValues() let col= sheet.getActiveCell().getColumn(); let row= sheet.getActiveCell().getRow(); if(col==1 && row>=2){ let lookupVal= sheet.getActiveCell().getValue() let position= model[0].indexOf(lookupVal) let data =modelSheet.getRange(2,position+1,3,1) let rule= SpreadsheetApp.newDataValidation() .requireValueInRange(data) .build(); sheet.getActiveCell().offset(0,1).clearContent(); sheet.getActiveCell().offset(0,1).clearDataValidations(); sheet.getActiveCell().offset(0,1).setDataValidation(rule); } } function anotherDependentDropDown(){ let model = colorSheet.getRange('A1:M1').getValues() let col= sheet.getActiveCell().getColumn(); let row= sheet.getActiveCell().getRow(); if(col==2 && row>=2){ let lookupVal= sheet.getActiveCell().getValue() let position= model[0].indexOf(lookupVal) Logger.log(position) let data =colorSheet.getRange(2,position+1,3,1); Logger.log(data) let rule= SpreadsheetApp.newDataValidation() .requireValueInRange(data) .build(); sheet.getActiveCell().offset(0,1).clearContent(); sheet.getActiveCell().offset(0,1).clearDataValidations(); sheet.getActiveCell().offset(0,1).setDataValidation(rule); } }
0 टिप्पणियाँ
Thanks For Message Me if any issue please feel free to contact