От Дмитрия Соловей — @solovey_nchub
Данная формула берет строку из БД, трансформирует в массив, а далее для каждого ключа присваивается переменная которая принимает значение 0 или 1, и таким образом переключает значение галочки при использовании предзаполнения.
let({
array: split(roleid.rows[0].keys, ', '),
newsFull: if(join(filter(array, item == "newsFull0" or item == "newsFull1")) == "newsFull1", 1, 0),
fileBasic: if(join(filter(array, item == "fileBasic0" or item == "fileBasic1")) == "fileBasic1", 1, 0),
fileFull: if(join(filter(array, item == "fileFull0" or item == "fileFull1")) == "fileFull1", 1, 0),
reportsClientBasic: if(join(filter(array, item == "reportsClientBasic0" or item == "reportsClientBasic1")) == "reportsClientBasic1", 1, 0),
forecast: if(join(filter(array, item == "forecast0" or item == "forecast1")) == "forecast1", 1, 0),
financeBasic: if(join(filter(array, item == "financeBasic0" or item == "financeBasic1")) == "financeBasic1", 1, 0),
financePlanerFull: if(join(filter(array, item == "financePlanerFull0" or item == "financePlanerFull1")) == "financePlanerFull1", 1, 0),
financePrize: if(join(filter(array, item == "financePrize0" or item == "financePrize1")) == "financePrize1", 1, 0),
crmBasic: if(join(filter(array, item == "crmBasic0" or item == "crmBasic1")) == "crmBasic1", 1, 0),
crmFull: if(join(filter(array, item == "crmFull0" or item == "crmFull1")) == "crmFull1", 1, 0),
crmDelete: if(join(filter(array, item == "crmDelete0" or item == "crmDelete1")) == "crmDelete1", 1, 0),
callcenterBasic: if(join(filter(array, item == "callcenterBasic0" or item == "callcenterBasic1")) == "callcenterBasic1", 1, 0),
callcenterFull: if(join(filter(array, item == "callcenterFull0" or item == "callcenterFull1")) == "callcenterFull1", 1, 0),
callcenterScripts: if(join(filter(array, item == "callcenterScripts0" or item == "callcenterScripts1")) == "callcenterScripts1", 1, 0),
teamBasic: if(join(filter(array, item == "teamBasic0" or item == "teamBasic1")) == "teamBasic1", 1, 0),
knowlageBaseFull: if(join(filter(array, item == "knowlageBaseFull0" or item == "knowlageBaseFull1")) == "knowlageBaseFull1", 1, 0),
ideaFull: if(join(filter(array, item == "ideaFull0" or item == "ideaFull1")) == "ideaFull1", 1, 0),
hrBasic: if(join(filter(array, item == "hrBasic0" or item == "hrBasic1")) == "hrBasic1", 1, 0),
hrFull: if(join(filter(array, item == "hrFull0" or item == "hrFull1")) == "hrFull1", 1, 0),
clientServiceBasic: if(join(filter(array, item == "clientServiceBasic0" or item == "clientServiceBasic1")) == "clientServiceBasic1", 1, 0),
clientServiceFull: if(join(filter(array, item == "clientServiceFull0" or item == "clientServiceFull1")) == "clientServiceFull1", 1, 0),
administrator: if(join(filter(array, item == "administrator0" or item == "administrator1")) == "administrator1", 1, 0),
},
administrator
)
Простой текст
Работает на Creatium