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.
Lotus IBM

Avatar of undefined
Last Comment
madheeswar

8/22/2022 - Mon
SOLUTION
Sjef Bosman

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER CERTIFIED SOLUTION
madheeswar

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Sjef Bosman

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.
madheeswar

Yes....you are correct Sjef.

Sjef Bosman

No, you were correct... ;-)
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
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.
madheeswar

@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.
Sjef Bosman

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)
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
NSCexpert

ASKER
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.
madheeswar

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.
Sjef Bosman

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.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
p_partha

Wonderful explanation ;)

Partha
Sjef Bosman

*bow*

Thank you :-))
Sjef Bosman

Thanks! You could have let Madheeswar in, by splitting the points?
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
madheeswar

Where's my share?
:(

NSCexpert

ASKER
Madheeswar I O U 250.
Sjef Bosman

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.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
madheeswar

Sjef,
Appreciate for your kindness .....