Skip to main content

Hello,

 

I am trying to get a field named “Statsig Url” in a table named Experiments (this is a field with the url type).

 

(My intent is to get the record id based on the value of the Statsig Url field). A filter will be applied in the url.

 

let table = base.getTable("Experiments");

console.table( await table.selectRecordsAsync( {"fields" : l"Experiment Name", "StatSig Link"]}));

console.table( await table.selectRecordsAsync( {"fields" : table.fields}));

I have tried with different approaches (testing other fields...). Each time I only get the primary key.

 

A workaround is  this : 
 

let query = await table.selectRecordsAsync({ fields: s"StatSig Link"] });

for (let record of query.records) {
console.log(record.getCellValueAsString("StatSig Link"));
}

But i guess it would had been better to filter within the query


Yeah unfortunately we can’t filter via the query with the Scripting API, and so I think you’re going to have to get everything and then filter it I’m afraid.  If your values are really static then you could try to use a view for this, but probably isn’t worth the effort really

 

The Web API does let you filter, oddly enough


Thank you ​@TheTimeSavingCo 


Reply