The problem I’m facing is hiding the section title if ALL the questions and responses of that section are empty. If I don’t do this and all the responses are empty the user will just see a title on its own.
Probably best to use JavaScript for this (either SSJS or just regular client side JS).
If you drop all the responses into an array and check if anything has a value, you could get away with something along the lines of:
<script runat="server">
var responses = ['%response_368_q1%','%response_368_q2%','%response_368_q3%','%response_368_q4%','%response_368_q5%'];
if (!responses.reduce((acc, val) => !!val || acc, false)) {
print ("<h1> You didn't fill in any fields!");
}
</script>
(assuming you’re on >=5.4)
The JS-less alternatives are fairly obtuse. You can’t do any OR logic with the responses, and the ^empty keyword modifier doesn’t appear to behave as I’d expect when used in a conditional keyword (on 5.5). You’d probably be left with something like: