Templates Plugins Courses

dataTables : Search comes back empty

Hi Zeroqode

Really enjoying and finding great use cases for the plugin dataTables. Definitely keen to update my recent review to tell the community about the power of using this plugin along with “grouping with” in searches.

In general, I’m facing issues when a “Do a search for…group by…” results in an empty result (null). In my case its numbers. One isn’t able to add a “defaulting to 0” or a sum+0 because one isn’t able to then add the <join with “,”> component.

image

There are legitimate reasons for a “sum” to result in 0 and not < null / empty>, i.e. selling 3 products to 1 client, for a particular month, they may only purchase 2 of the 3, which means that sales should be equal to 0, and not blank/null for one column (which is a product line).

I tried various things like <join with 0",">, plus item 0, defaulting to 0, none of them worked.

From the image below I used <join with “-,”> , as you can see the - didn’t come up when the search resulted in being empty for those particular cells.

image

The error that comes up, as you can imagine, looks like this
image

The website https://datatables.net/manual/tech-notes/4 does incorporate a “null” or “undefined” data component to resolve these issues. The website states that " With columns.defaultContent set, any null or undefined value will be replaced with the value specified. No warning will be shown in this circumstances."

Are you able to add the ability to default to 0, or another clever trick to resolve this issue ( “Do a search for…group by…null”) when these tables are being processed ?

Thank you so much

Hello @allonp. Thanks for reaching out and apologies for the late reply.

I understand this question, please let us check it with our dev team. As well as the error you have reported after. I will inform you once the investigation will be finished, thus it can take some time because of the local holidays we have here. Still, we will try to get back to you asap :pray:

Thank you for understanding.

1 Like

@allonp, thank you for your patience :pray:

We have checked your case with the dev team. It appears that the problem in the Bubble logic you used because the “join with” can return a text value from the list:
a = ['Wind', 'Water', 'Fire'];
a join with ''; // 'Wind,Water,Fire'
a join with', '; // 'Wind, Water, Fire'
a join with''; // 'WindWaterFire'
If you use the “sum” function - it’s a number, but not a list. So in your expression, you’re trying to use a text value with the number, which is against the Bubble logic.

I hope it helps. Take care :slightly_smiling_face: