Filter or remove respondents

8e0d61d9a128eed248465831eee8d5de

Updated at November 25th, 2019

If you have respondents that you want to remove from the Protobi view, you can add a snippet of code in "Pre-calculate" to filter out the respondents:

rows = rows.filter(function(row) { 
    if (row.respid == "101") return false      // remove respondent with respid ="101"
    if (row.respid == "102") return false      // remove respondent with respid ="102"
    if (row.status == "INCOMPLETE") return false // remove incomplete respondents

    return true                                // do not remove anyone else
})

return rows;

 

The logic is straight forward; edit the "if" statement to return false for respondents that you want to remove, and return true for those you want to keep. This code can work either in the pre-calculate or as a data process.


Was this article helpful?