Skip to main content

I have the following code that is looking for the value of a calculated field. But I’m getting an Error: no field matching …


let rootTableDat = await rootTable.selectRecordsAsync(

{

fields: d“Zeiss Planar 80mm 2.8-Prontor CB”]

}

);


Should this work? Is there a preferred way of doing this?

Thanks.

Is that the exact name of the field?


Is that the exact name of the field?


The field I want to search is called ‘Name’. I thought ‘fields’ searched all columns/fields???


The field I want to search is called ‘Name’. I thought ‘fields’ searched all columns/fields???



I don’t know what that is supposed to mean.


The “fields” key in the object passed into selectRecordsAsync() asks: “Which fields should come included in the returning records list”. If your field is called “Name”, then you should have put fields: l"Name"].


If you’re trying to find the record where Name = “Zeiss Planar 80mm 2.8-Prontor CB”, you can do that by filtering a list of records, which would look something like this: records.filter(x=> x.getCellValueAsString("Name") === "Zeiss Planar 80mm 2.8-Prontor CB")



I don’t know what that is supposed to mean.


The “fields” key in the object passed into selectRecordsAsync() asks: “Which fields should come included in the returning records list”. If your field is called “Name”, then you should have put fields: p"Name"].


If you’re trying to find the record where Name = “Zeiss Planar 80mm 2.8-Prontor CB”, you can do that by filtering a list of records, which would look something like this: records.filter(x=> x.getCellValueAsString("Name") === "Zeiss Planar 80mm 2.8-Prontor CB")


Here’s the entire code:



console.log(Database = ', ${base.name}!);

let rootTable = base.getTable(“LensShutter”);

console.log('Root Table = ', rootTable.name);

let linkedTable = base.getTable(“Shutter”);

console.log('Linked Table = ', linkedTable.name);

let view = rootTable.getView(“Grid view”)


let rootTableDat = await rootTable.selectRecordsAsync(

{

fields: s“Name”]

}

);


console.log(rootTableDat)



How do I filter the records?


Here’s the entire code:



console.log(Database = ', ${base.name}!);

let rootTable = base.getTable(“LensShutter”);

console.log('Root Table = ', rootTable.name);

let linkedTable = base.getTable(“Shutter”);

console.log('Linked Table = ', linkedTable.name);

let view = rootTable.getView(“Grid view”)


let rootTableDat = await rootTable.selectRecordsAsync(

{

fields: b“Name”]

}

);


console.log(rootTableDat)



How do I filter the records?


I already gave you how to filter records. The only difference you’d make is changing records to rootTableDat.records


Reply