Hi, I have a problem with my code. I have tried to limit linked records to specific view, but the view must change based on the chosen record from the previous column. My problem is how to change column->options.viewIdForRecordSelection?
Here is my code:
let table = base.getTable("_Zlecenia");
let field = table.getField(“Technik”);
let result = await table.selectRecordsAsync();
let value = input.config().Nazwa_Projektu;
console.log(table.fields[7].options.viewIdForRecordSelection);//this is the field that I want to influence on?
let _tableT = base.getTable("_Technicy");
let view = _tableT.views;
let num = 0;
let valueId = ‘’;
let replacements = ;
for(var i=0;i<view.length;i++)
{
if(view[i].name == value[0])
{
valueId = view[i].id; //take the id of view I want to change on
num = i;
replacements.push({num,before:table.getField(“Technik”).options.viewIdForRecordSelection,after:valueId }) //probably irrelevant
}
}
await table.updateRecordsAsync(table.fields[7].options.viewIdForRecordSelection,replacements); //How to put the new value here?