(SOLVED) - What am I missing? (syntax problem?)

@russian-dima Thanks my friend. Just for the sake of it, the steps are these (copy-paste from you, above):

  1. You have a DATABASE where you have some items in it.
    as a matter of fact, I have 2 connected databases through a reference field.
  2. This DATABASE is connected with a DATASET. (let us say all settings are ok).
    for each DB collection I’ve set up a dataset on the page in order to be able to use dataset2 values to filter (dropdown) dataset1 values. I followed the tutorials for this.
  3. Now the action which you want to achieve, let us say the following…

To achieve this, I add a filter to Dataset1 based on the referenced field in Dataset2 (‘includes’ relationship). Dataset2 values are also values of a dropdown. So when I select a value from this dropdown, the whole Dataset1 is filtered based on this value (it’s the Actors and Movies tutorial, somewhere).

So, strangely enough, if I delete this filter, in other words, if I delete the connection between 2 datasets, your code and J.D. code was working fine (the on.Ready()) part. But if I do this, I just can’t filter my records any more .

So since the export function was already working to count the total number of items, I crossed my fingers and decided to put the if-else and .show - .hide just below it.

And it worked!!