Help

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

Solved
Jump to Solution
693 0
cancel
Showing results for 
Search instead for 
Did you mean: 
NICK75
5 - Automation Enthusiast
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 ?
 
Thanks in advance
 
{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
NICK75
5 - Automation Enthusiast
5 - Automation Enthusiast

Thanks so much, it is working fine this way.

 

See Solution in Thread

3 Replies 3

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"
)

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 

Alexey_Gusev_0-1696186745554.png

 

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})






NICK75
5 - Automation Enthusiast
5 - Automation Enthusiast

Thanks so much, it is working fine this way.