Category: How do I do X?
Updated

This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord.

Data Filtering for null values in a Table?

Issue

I am trying to display data on a table where the "Company" column is not empty. I used the filter method but it didn't populate any results even though there are data in the "Company" column. I need to know if there's another way to do this or if I missed something. Also, I encountered another problem where the column name contains an apostrophe and it's giving me a syntax error. I need to know how to include the correct field name.

Resolution

The issue involved displaying data on a table where the column Company is not null. The initial attempt used { {getID.data.filter( item => item.Company !== "" )} } but did not yield any results even though there were data in the Company column. Upon further inspection, it was discovered that the column name in the table was renamed to “Company” and the actual table in database was “Company :”.

To solve the issue, it was advised to use the actual column name in the database in the filter function. The solution then was { {getID.data.filter( item => item['Company :'] !== "")} } and this worked. However, another issue arose where a data column had " ' " in it and the filter function was causing a syntax error. To solve this, the solution was to escape the " ' " with a backslash, resulting in the code { {getID.data.filter( item => item[‘Company\’s Email:’] !== “”)} }.