# Pb : the empty lines don't show up and don't make a line break with empty lines.

Topic Labels: Formulas
Solved
709 3
cancel
Showing results for
Did you mean:
5 - Automation Enthusiast
Hello community,
My script do not work if the field is blanc there is a line break. however, i need the linebreak when there is a record.
How can I do ?

{MARQUES} &
IF({DESIGNER}, " X " & {DESIGNER}) &
IF({DATATION}, " - " & {DATATION}) & "\n" &
IF({COLLECTION}, " " & {COLLECTION}) & "\n" &
IF({FABRICATION}, " " & {FABRICATION}) & "\n" &
IF({PRODUIT}, " " & {PRODUIT}) &
IF({MODELE}, " - " & {MODELE}) & "\n" &
IF({MATIERES}, " " & {MATIERES}) & "\n" &
IF({COULEURS}, " " & {COULEURS}) & "\n" &
IF({DETAIL}, " " & {DETAIL}) &
IF({GRIFFES}, " , " & {GRIFFES}) & "\n" &
IF({PROVENANCE}, " " & {PROVENANCE}) & "\n" &
IF({TAILLES}, " " & {TAILLES}) & "\n" &
IF({CONDITION REPORT}, " " & {CONDITION REPORT} & "\n" &
IF({ICONOGRAPHIES}, " " & {ICONOGRAPHIES})
)
1 Solution

Accepted Solutions
5 - Automation Enthusiast

Thanks so much, it is working fine this way.

3 Replies 3
18 - Pluto

Move your line breaks inside the appropriate IF() function instead of between your IF() functions, as I explain here.

You do not have a line break after every field, so you might need to add some logic that looks at multiple fields to determine if there should be a line break:

``````IF(
OR({field1}, {field2}, {field3}),
"\n"
)``````
12 - Earth

It's not script, it's a formula ))
You need to finish IF( ) after the line break, not after the field name, as it is now
To save time, you can open Notepad, paste it there and

press 'Replace all"

The result is (I don't want to create all these fields to test):

``````{MARQUES} &
IF({DESIGNER}, " X " & {DESIGNER}) &
IF({DATATION}, " - " & {DATATION} & "\n") &
IF({COLLECTION}, " " & {COLLECTION} & "\n") &
IF({FABRICATION}, " " & {FABRICATION} & "\n") &
IF({PRODUIT}, " " & {PRODUIT}) &
IF({MODELE}, " - " & {MODELE} & "\n") &
IF({MATIERES}, " " & {MATIERES} & "\n") &
IF({COULEURS}, " " & {COULEURS} & "\n") &
IF({DETAIL}, " " & {DETAIL}) &
IF({GRIFFES}, " , " & {GRIFFES} & "\n") &
IF({PROVENANCE}, " " & {PROVENANCE} & "\n") &
IF({TAILLES}, " " & {TAILLES} & "\n") &
IF({CONDITION REPORT}, " " & {CONDITION REPORT} & "\n" &
IF({ICONOGRAPHIES}, " " & {ICONOGRAPHIES})``````

5 - Automation Enthusiast

Thanks so much, it is working fine this way.