Hello, I'm currently developing an app that allows users to filter companies from a table. The user selects a company from a list, which is used to apply a filter in a 'where' condition. For example, if the user selects Company A the filter in the query would be 'company IN ("Company A").
However, a challenge arises when the user wants to see more than one company. In this case, the query would look like 'company IN (""Company A", "Company B"").' The issue is that the double quotation marks are repeated, causing the query to search for a non-existent company that combines both names.
Here's a real code fragment illustrating the problem:
WHERE Company IN ({{ company_list.value }})
Result of selecting one company: WHERE Company IN ({{"Company A"}})
Result of selecting multiple companies: WHERE Company IN ({{""Company A", "Company B""}})
To resolve this issue, the query should be: WHERE Company IN ({{"Company A", "Company B"}}) In this case, the double quotation marks are used only once for each company.