=QUERY(FLATTEN(BYROW(
A1:A14;
LAMBDA(ROW;IF(OR(ROW="Голубой";ROW="Желтый");{ROW\""\""};{ROW\""\"-"}))
));"where Col1<>'-'")
function creator({docFile_Doverennost, docFolder_TVO}) {
}
creator
убрать вот эти строки// это константы для шаблонов
const docFile_Doverennost = ("id шаблона докфайла В")
// это константы для каталогов
const docFolder_TVO = ("id папки С")
const items = [
{
docFile_Doverennost: "XYZ_123",
docFolder_TVO: "ABC_456"
},
{
docFile_Doverennost: "XYZ_4352134523",
docFolder_TVO: "ABC_456"
}
];
items.forEach(creator);
=ARRAYFORMULA(QUERY(SPLIT(FLATTEN(A2:A6&"_"&B2:E6);"_");"where Col2<>''"))
Cheerio
.const url = 'https://www.pdfah.com/product/4944/hylo-gel-lubricating-eyes-drops-%E0%B8%99%E0%B9%89%E0%B8%B3%E0%B8%95%E0%B8%B2%E0%B9%80%E0%B8%97%E0%B8%B5%E0%B8%A2%E0%B8%A1%E0%B8%8A%E0%B8%99%E0%B8%B4%E0%B8%94%E0%B9%80%E0%B8%88%E0%B8%A5-10ml-300%E0%B8%AB%E0%B8%A2%E0%B8%94';
function getData() {
const data = UrlFetchApp.fetch(url);
const content = data.getContentText();
const exec = /application\/ld\+json">(.*?)<\/script>/gi
.exec(content.replace(/[\r\n]+/g, ' '));
if (exec) {
const product = JSON.parse(exec[1]);
console.log(product);
}
}
function Q(table, query, i) {
return [table, query][i];
}
=QUERY(
Q({1\2\3\4;5\6\7\8};"select Col1, Col2";0);
Q({1\2\3\4;5\6\7\8};"select Col1, Col2";1);
0
)
function run() {
const book = SpreadsheetApp.getActive();
const matcher = new RegExp('метка (\\d+$)', 'i');
const sheetChecker = (sheet) => {
const [_, num] = sheet.getSheetName().match(matcher) || [];
if (Number(num) >= 2 || Number(num) <= 6)
book.deleteSheet(sheet);
}
deleteSheets_(book, sheetChecker);
}
/**
* @param {globalThis.SpreadsheetApp.Spreadsheet} book
* @param {SheetChecker} sheetChecker
* @returns {void}
*/
function deleteSheets_(book, sheetChecker) {
book.getSheets().forEach(sheet => {
if (sheetChecker(sheet)) {
book.deleteSheet(sheet);
}
});
}
/**
* Проверяет, подходит ли лист для обработки
* @callback SheetChecker
* @param {globalThis.SpreadsheetApp.Sheet} sheet
* @returns {boolean}
*/
sheetChecker
, можно удалять любые листы, которые будут валидны проверке в этой функции. const isFormula_ = value => String(value).charAt(0) === '=';
const editValue_ = value => isFormula_(value) ? String(value).substring(1) : value;
function onEdit(e) {
const sheet = e.range.getSheet();
if (
sheet.getName() === 'Пример' &&
e.range.getRow() > 1 &&
e.range.getColumn() === 8 &&
isFormula_(e.value)) {
e.range.setValue(editValue_(e.value));
}
}
=MATCH("Мышка";$A1:$F1;)
function onEdit(e) {
const sheet = e.range.getSheet();
if (sheet.getName() === 'Пример' && e.range.getRow() > 1 && e.range.getColumn() === 2) {
sheet.getRange(e.range.getRow(), 1).setValue(new Date());
}
}
const excludeSheetNames = (sheetName) => !['О Таблице', 'Исключить этот листо тоже', 'Лист 1'].includes(sheetName);
function onEdit(e) {
const sheet = e.range.getSheet();
if (excludeSheetNames(sheet.getName()) && e.range.getRow() > 1 && e.range.getColumn() === 2) {
sheet.getRange(e.range.getRow(), 1).setValue(new Date());
}
}