Hi all,
I have a template to create a PDF document, which contains:
<<If: ISNOTBLANK([Textblock 1])>><<[Textblock 1]>><<EndIf>>
<<If: ISNOTBLANK([Textblock 2])>><<[Textblock 2]>><<EndIf>>
<<If: ISNOTBLANK([Textblock 3])>><<[Textblock 3]>><<EndIf>>
If e.g. "[Textblock 1]" is blank an empty line exists, but if "[Textblock 1]" is not blank it should be in a new line.
How can I avoid the empty line?
I tried:
<<If: ISNOTBLANK([Textblock 1])>>
<<[Textblock 1]>><<EndIf>><<If: ISNOTBLANK([Textblock 2])>>
<<[Textblock 2]>><<EndIf>><<If: ISNOTBLANK([Textblock 3])>>
<<[Textblock 3]>><<EndIf>>
But this throws an error: 'If: ISNOTBLANK([Textblock 2])' is invalid due to: Unable to find function 'IF: ISNOTBLANK', did you mean 'ISNOTBLANK'?
I tried:
<<If: ISNOTBLANK([Textblock 1])>><<
[Textblock 1]>><<EndIf>><<If: ISNOTBLANK([Textblock 2])>><<
[Textblock 2]>><<EndIf>><<If: ISNOTBLANK([Textblock 3])>><<
[Textblock 3]>><<EndIf>>
But this throws also an error: Contains start token '<<' without matching end token '>>'
Thanks, Joachim
Keep in mind that the IF's and ENDIF's do not take up lines in the generated doc.
Try it like this:
<<If: ISNOTBLANK([Textblock 1])>>
<<[Textblock 1]>>
<<EndIf>>
<<If: ISNOTBLANK([Textblock 2])>>
<<[Textblock 2]>>
<<EndIf>>
<<If: ISNOTBLANK([Textblock 3])>>
<<[Textblock 3]>>
<EndIf>>
Thank you @WillowMobileSys ,
I'm not sure if I understand you, but
<<If: ISNOTBLANK([Textblock 1])>>
<<[Textblock 1]>>
<<EndIf>>
will make an empty line if [Textblock 1] is empty.
Did you try it?
yes, see the empty line between "Sehr geehrte Frau..." and "der örtliche..."
In your case you should be using an IFS() instead of a Template IF
Template If Expressions | AppSheet Help Center
Template If is used when you want to hide certain portion on your template:
So, use this instead:
<<IFS(
ISNOTBLANK([Textblock 1]), [Textblock 1],
ISNOTBLANK([Textblock 2]), [Textblock 2],
ISNOTBLANK([Textblock 3]), [Textblock 3]>>
Thank you @SkrOYC I will try this tomorrow
Ahhh. What you are seeing is NOT a blank line. It is the default Paragraph spacing.
I assume you are using Google Sheets? You will want to use the Custom Spacing option to adjust the space between lines. See below.
Choose "Custom spacing" option
Adjust the Paragraph spacing points
Then you will go from This...
To This (only the Blocks side was changed)...
User | Count |
---|---|
15 | |
11 | |
10 | |
8 | |
3 |