How to Hide Elements based off other empty Elements?

I’ve rearranged the code by taking out (“#dynamicDataset”) on ligne 1.
However, now #group1 hides on every page regardless of the what happens in #text29.

What is missing?