I’m generating a legal document and depending on user input some sections will show if they have a value, or be hidden if they are empty.
Based on that, the numbers of the subsequent sections will be different.
For example, Clause 1, 2 & 3 are always present in the document.
Clauses 4, 5 & 6 are only present in the document when they have a value.
Clauses 7-10 are always present.
So, let’s take Clause 7 as a demonstration (although the same logic will apply to 8,9 & 10).
If there are no values in 4, 5 or 6, Clause 7 should now be numbered Clause 4 - it will come after Clause 3. And the following clauses will be 5,6 & 7.
If there is a value in Clause 5 but not in 4 or 6, then Clause 5 will become Clause 4 and Clause 7 will become Clause 5 (the next number) and the following numbers will be 6,7 & 8.
So, for numbering the original Clause 7, I’ve written an expression that Does a Search for the Count of Clauses 4,5 & 6 > 0 and formats them as a number, in this case a Boolean, where yes = 1 and no = 0. Then I add 4.
So if 4,5 & 6 were empty ( Count not > 0) the value should be 0 and the number of Clause 7 would be 4 - 0+0+0+4.
If all 3 had values ( Count > 0, yes = 1 )then Clause 7 would remain 7 - 1+1+1+4 = 7.
That’s all good in theory, but when I try to add the Boolean values in my expression, they don’t add. They only ever sum to 1.
In my screenshots, there are values in all sections so I would expect to see 7, however I only see 5.
It says that the expression should evaluate to a number so I don’t see why it doesn’t work. Any ideas?

