You have the layout setup correctly ‘Collapse when hidden.’ All you have to do now is set a condition such as when ‘dynamic value is empty’ then ‘this element isn’t visible: check’