Yes.
Despite being able to code anything you can imagine for filtering, the best way is to not code at all for filtering. Instead, lean on views to do all the filtering and allow the scripts to read the views, then counting becomes a very simple script.
Yes.
Despite being able to code anything you can imagine for filtering, the best way is to not code at all for filtering. Instead, lean on views to do all the filtering and allow the scripts to read the views, then counting becomes a very simple script.
Hi Bill - We need to do it all in the scripting at the moment. Even if we filter by user and session, it’s too complex to do the calculations without the filtering.
That being said, what’s the best way to do this with filtering?
I am getting an error ‘Block-scooped variable used before declaration’ even though it is below the filter.
Hi Bill - We need to do it all in the scripting at the moment. Even if we filter by user and session, it’s too complex to do the calculations without the filtering.
That being said, what’s the best way to do this with filtering?
I am getting an error ‘Block-scooped variable used before declaration’ even though it is below the filter.
I think this is a javascript error - tough to debug without seeing the script.
Hi Bill - We need to do it all in the scripting at the moment. Even if we filter by user and session, it’s too complex to do the calculations without the filtering.
That being said, what’s the best way to do this with filtering?
I am getting an error ‘Block-scooped variable used before declaration’ even though it is below the filter.
Have you, perhaps, inadvertently reused a variable name?
I noticed in another post that you had variable names like f_client
and result2
. I would encourage using much more descriptive names, regardless of their length or tedium of typing them, because 1) it makes your code easier to read and reason about, and 2) makes it less likely you’ll accidentally duplicate a variable across scopes.
Have you, perhaps, inadvertently reused a variable name?
I noticed in another post that you had variable names like f_client
and result2
. I would encourage using much more descriptive names, regardless of their length or tedium of typing them, because 1) it makes your code easier to read and reason about, and 2) makes it less likely you’ll accidentally duplicate a variable across scopes.
Hi Jeremy -
No, the error is coming after. This is the code:

for (i = 0; i < f_thisclient.length; i++) {
let symname = f_thisclientni].getCellValueAsString("Symptom")
let clemail = f_thisclientni].getCellValueAsString("Client_Email")
let sesidlinked = f_thisclientni].getCellValueAsString("Session_ID_linked")
let sesidnl = f_thisclientni].getCellValueAsString("Session_ID")
let syman = f_thisclientni].getCellValueAsString("term_id_via_cr_table")
console.log(symname)
console.log(clemail)
console.log(syman)
console.log(sesidlinked)
console.log(sesidnl)
// We want to filter out the relationships table await: result3 for only this symptom
let f_theseR = result3.records.filter(f_record =>
//works f_record.getCellValueAsString("Client_Email") ==v_this_client_string
f_record.getCellValueAsString("id_L") ==syman
);
for (j = 0; j < f_theseR.length; j++) {
let defstr = f_theseRej].getCellValueAsString("Deficiency, System Failure, or Irritant")
let defnum = f_theseRej].getCellValueAsString("id_R")
// Need to add
let f_theseR = result3.records.filter(f_record =>
//works f_record.getCellValueAsString("Client_Email") ==v_this_client_string
f_record.getCellValueAsString("id_R") ==defnum
);
}
}