Can If /Endif Span lines in a template?

Can If /Endif Span lines in a template?

Below does not seem to work? I need to conditionally include a large (repeating) section in a google PDF template.

<<If: [Total Score] > 0 >>

<<[Item]>> - Score: <<[Total Score]>>

More stuff here as well

<>

you are missing closing with " < < EndIf > >", most likely that could be a reason.

1 Like

I’ve have the EndIf with <<>> in

I think it does not work if spend over multiple paragraphs

Yes

Sometimes it does work but 1 below works, but 2 does not?
(BTW ENDIF does not show up in this editor!)

1 (No paragraph before ENDIF)

<<IF: [Asbestos Status] = “Identified”>><<[Asbestos Status]>><>

2 (Paragraph before ENDIF)

<<IF: [Asbestos Status] = “Identified”>><<[Asbestos Status]>>
[Another Variable]
<>

Please post a screenshot of the actual template.

1 Like

see this screenshot example

image

I would ensure that what is in the red box is a separate table, and the IF and ENDIF are not part of that table.

1 Like

I got to the bottom of it. There is a glitch in the AppSheet expression parser.

After the ENDIF there was another IF expression on the next page. Once I put a blank paragraph after the ENDIF it all worked!

After further investigation, it was not just the page break causing the issue. It was just the fact that the an IF followed an ENDIF without a paragraph in between.

This does not work

ENDIF
IF …

This does

ENDIF

IF …

1 Like