Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Juggernaut

Default mail address ( )

Featured Replies

Name & Parameters: [color:red][big] Default mail address ( ) [/big]

Description:

Sample Input:

Results:

Recursive: no

Formula:

I'm working on the following calculation.



Case(

    Mail To = "Home";

    Mailing Full Name & "¶" & Home Street & ¶ & Home City & "," & " "& Home State & "  " & Home Zip Code;

    

Mail To = "Work";

    Mailing Full Name & Case(IsEmpty ( Title );"";   ", " & Title) & Case(IsEmpty (Company) ; "";¶ & Company & ¶ & Work Street & ¶ & Work City & "," & " " & Work State & "  " & Work Zip Code;

    

Mail To ="Spouse Work";

    Spouse Mailing Full Name  & Case(IsEmpty ( Spouse Title );"";   ", " & Spouse Title) & Case(IsEmpty ( Spouse Company ) ;"";¶  & Spouse Company) & ¶ & Spouse Work Street & ¶ & Spouse Work City & "," & " " & Spouse Work State & "  " & Spouse Work Zip Code)





Everything was working fine until I added the IsEmpty scenarios to Mail To = Work.  When I copied and pasted Mail To = Spouse Work into Mail To = Work and changed the appropriate fields, Spouse Work returned nothing and Work returned:



Name and a comma

Title with a 0



I can't imagine that copying and pasting would change the values in Spouse Work and can't figure out why I'm not getting the correct results in Work.



The results should be:



Name, Title

Company

Street

City, State  Zip Code



with Title and Company eliminated if nothing is entered in those fields and no blank line if Company is not entered.



Thanks,

ajnhlr



FM Pro Advanced 8.3

Mac 10.4.6

 

Required Functions:

Author(s): ajnhlr

Date: 05/24/06

Credits:

Disclaimer:

FM Forums does not endorse or warrantee these files are fit for any particular purpose. Do not post or distribute files without written approval from the copyright owner. All files are deemed public domain unless otherwise indictated. Please backup every file that you intend to modify.

Looks like you forgot a parenthesis when you were concatenating Company in the Work portion of your formula. Here's the entire formula:

Case(

Mail To = "Home";

Mailing Full Name & "¶" & Home Street & ¶ & Home City & "," & " "& Home State & " " & Home Zip Code;

Mail To = "Work";

Mailing Full Name &

Case(IsEmpty(Title); ""; ", " & Title) &

Case(IsEmpty (Company) ; "";¶ & Company) & ¶ & Work Street & ¶ & Work City & "," & " " & Work State & " " & Work Zip Code;

Mail To ="Spouse Work";

Spouse Mailing Full Name &

Case(IsEmpty ( Spouse Title );""; ", " & Spouse Title) &

Case(IsEmpty ( Spouse Company ) ;"";¶ & Spouse Company) & ¶ & Spouse Work Street & ¶ & Spouse Work City & "," & " " & Spouse Work State & " " & Spouse Work Zip Code)

It would sure be easier overall if each person (and address) was a record instead of several fields. I would think you will run into many problems with this setup. Just a thought ...

This doesn't need to be a Custom Function and I'll move it to Define Fields a bit later after ajnlhr reads it. :wink2:

  • Author

Thanks. That works, except it leaves a blank line if Company doesn't have any data entered in it. Any suggestions?

I can't replicate the problem with the calculation I gave you. I removed the Company value and it works fine. Maybe you copied the formula incorrectly?

You want to use the Not with the isEmpty.

I don't agree with your single field name, unless it is Concatenate

Case(not IsEmpty(Name); Name) & " " &

Case(not IsEmpty(Title); Title) &

Case(not IsEmpty(Company); "¶" & Company) &

Case(not IsEmpty(Street); "¶" & Street) &

Case(not IsEmpty(City); "¶" & City) &

Case(not IsEmpty(State); "¶" & State) &

Case(not IsEmpty(Zip); "¶" & Zip)

HTH

Lee

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.