Filtering – Scripting – Example

In this example we will replace the Content filter with a Script filter while keeping the same condition.

  • Open 06_Table_FilteringContent_DONE.wfd and investigate the table's Content filter condition.

  • Remove the Content filter and create a Script filter.

  • Script a condition which will have the same function as the Content filter.

  • let country_table = record.CountryLong.toLowerCase();
    let country_user = dataCtx.UserInput_CountryLong.toLowerCase();
    
    if (country_table.indexOf(country_user) != -1)
       {
       return true;
       }
    else return false;
  • See 07_Table_Filtering_Script_DONE.wfd for the solution.