o2d
June 27, 2022, 8:50am
1
Hello All,
I want to display data on a table where column Company is not null.
I’m currently trying to use this on Table Data but I’m not getting any results populated even though there are data in the Company column.
{{
getID.data.filter( item => item.Company !== "" )
}}
Is there another way to do it or am I missing something?
dancia
June 27, 2022, 9:56am
2
@o2d This should work. Are you seeing any errors? Did you change the name of the Column on the table or the database?
o2d
June 27, 2022, 2:34pm
3
The name of the Column in the table is “Company_” and the actual table in database is “Company :”, I renamed the table’s column in appsmith into “Company” but it did not work.
dancia
June 27, 2022, 2:40pm
4
@o2d Yes, I believe you have to use the name of the column in the database in the filter. Can you try the below snippet and let us know if it works
{{getID.data.filter( item => item['Company :'] !== "")}}
1 Like
o2d
June 27, 2022, 2:48pm
5
Thanks Dancia, this worked!
1 Like
o2d
June 30, 2022, 5:00pm
6
Hey Danica,
I have a data column with " ’ " in it, when i write this
{{getID.data.filter( item => item[‘Company’s Email’:’] !== “”)}}
Its picking up the " ’ " before the letter s in Company’s and giving me a syntax error, how do i include the correct field’s name?
dancia
June 30, 2022, 5:10pm
7
@o2d You can escape it with a backslash, so the below snippet should work
{{getID.data.filter( item => item[‘Company\’s Email:’] !== “”)}}