Link to home
Start Free TrialLog in
Avatar of NSCexpert
NSCexpert

asked on

@Mailsend Blank Lines

I have created an action button on my document which sends a copy of the a document to an email address using the @mailsend command. The document has 10 lines of values and then a total at the bottom.

The problem I have is that sometimes only 1 line has a value in it. So before the user can see the total they receive 9 lines of blank text in their email. Is there anyway to loose these blank lines ?

Maybe the question is can I use multiple @if statements within a mailsend command and if so could you provide some example formula code for me.
SOLUTION
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You mean something like this:
    @Implode(@Trim(line1:line2:line3:.......:line10); @Newline)

Depends, whether the form is sent or just content. If the form is sent, a display-only field could be added, with the above formula in it.
Yes....you are correct Sjef.

No, you were correct... ;-)
Avatar of NSCexpert
NSCexpert

ASKER

No only the content is sent via the mail send command so I cannot use the hide when formula.

This is the body of my mailsend command.

Field1 + @Newline +
Field2 + @Newline +
Field3 + @Newline +
Field4 + @Newline +
Field5 + @Newline +
FieldTotal

If fields 2,3,4 and 5 are empty then I still get the newlines so there is a big space between Field1 an FieldTotal.

Maybe I could do this
@if(Field1 != "";Field1 + @Newline;"")"" +
@if(Field2 != "";Field2 + @Newline;"")"" +
@if(Field3 != "";Field4 + @Newline;"")"" +
@if(Field4 != "";Field4 + @Newline;"")"" +
@if(Field5 != "";Field5 + @Newline;"")"" +
FieldTotal

Thoughts please.
@if(Field1 != "";Field1 + @Newline;"")"" +
@if(Field2 != "";Field2 + @Newline;"")"" +
@if(Field3 != "";Field4 + @Newline;"")"" +
@if(Field4 != "";Field4 + @Newline;"")"" +
@if(Field5 != "";Field5 + @Newline;"")"" +
FieldTotal


The above looks perfect... you can use it.
Perfect, hm.., I think you can do better, because all that is in the formula I (we) gave above:

    @Implode(@Trim(Field1:Field2:Field3:Field4:Field5:FieldTotal); @Newline)
Yes but wouldnt this put fields 2,3,4, and 5 next to each other instead of on a newline.
On the mail they need to be on a seperate line.
Sjef,
For a beginner the coded provided by NSCexpert will look good and easily understood.

NSCexpert,

The code given by Sjef will also work and you should be looking to code in that way. @Implode always splits into maulti lines using @Newline and if there is any empty field, that is not considered as @Trim will work on empty fields..


Hope it helps.
Exactly.

    @Implode(@Trim(Field1:Field2:Field3:Field4:Field5:FieldTotal); @Newline)

Some explanation:
    Field1:Field2:Field3:Field4:Field5:FieldTotal
        will take several strings and put them into a list of strings (a multi-value entity)
    @Trim(...)
        removes superfluous spaces and empty strings
    @Implode(...; @Newline)
        will concatenate all the remaining strings, and will separate these strings with a newline-sequence.

The result is that empty strings will be removed, and all texts including the total will be on separate consecutive lines.
Wonderful explanation ;)

Partha
*bow*

Thank you :-))
Thanks! You could have let Madheeswar in, by splitting the points?
Where's my share?
:(

Madheeswar I O U 250.
If you want to reopen the question, so you can split the points, put a question in the Community Support TA, with a link to this one.
Sjef,
Appreciate for your kindness .....