Jump to content

If, result help


Natea11

Recommended Posts

I'm looking for a fusion pro rule that will automatically position contact input from three fields four different ways. I imagine this would be achieved through a "if, result" scenario.

 

Variable fields are "phone" (required), "fax" (optional) and "cell" (optional) presented in a data pattern as such (###) ###-####.

 

Here's the if, result scenario.

1. If just the "phone" field has content then it's alone on one line and will appear as " t (###) ###-#### "

2. If the "phone" and "fax" are supplied the result will be " t (###) ###-#### | f (###) ###-#### " all on one line.

3. If "phone" and "cell" the result is " t (###) ###-#### | c (###) ###-#### "

4. The last scenario is if "phone" , "fax" and "cell" are supplied the result is " t (###) ###-#### | f (###) ###-#### <br> or hard return and c (###) ###-#### " so telephone and fax are on one line and the cell gets placed on the line below.

 

Here's what I have so far. It's return the phone, but that's all. And I don't think there's any data pattern.

 

if (Field("Fax") == "") and (Field("Cell") == ""); // Both Fax and Cell are empty

return ("p " + Field("Phone")); // returns just the Phone #

} else if ([Field("Fax") !== "") and (Field("Cell") == ""); // Fax is not empty and Cell is empty

return ("p" + Field("Phone")" | " "f " + Field("Fax")"<br>"); // returns Phone number & Fax

}else if (Field("Fax") == "") and (Field("Cell") !== ""); // Fax is empty and Cell is not empty

return ("p" + Field("Phone")" | " "c " + Field("Cell")"<br>"); // returns Phone number & Cell

} else // Last default resort, all fields contain something so you need the last scenario...

return ("p " + Field("Phone")" | " "f" + Field("Fax")"<br>" "c " + Field("Cell")"<br>"); // returns all the items

bcards_onesided.zip

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...