Over 46,000+ Business Solution Developers Find answers, ask questions, and connect with our community of business solutions developers, business owners and partners.
Text Formatting Using Auto-Enter Calculations in FileMaker – FileMaker Today
What you should know before reading this post:
Be familiar with the FileMaker software
Know how to add an Auto-Enter Calculation
Auto-Enter Calculations can make your solution easier to use and defend your solution’s users from unintended problems with their data.
This week, I will share with you three simple, easy to use FileMaker functions that can be used with Auto-Enter Calculations (aka Auto-Calcs). This post will review text formatting using Auto-Enter calculations in FileMaker. This post will be part of an ongoing blog series reviewing key functions in FileMaker.
Function Review #1: Text Formatting to Uppercase
There are many functions that are helpful in making our solutions more user friendly. The UPPER function is one of those. It could be used in excess and be too much, but in just the right places it’s perfect.
For example, one instance where it could be used and benefit your solution is auto capitalization of the state field (AL, AK, AX, AR, CA, CO, etc.) where address/location information is.
As an example, I will use the Invoices FileMaker starter solution during this blog post. The state field starts as a simple text field. Now, we will be adding an Auto-Enter Calculation to that field. The Auto-Enter Calculation we will use is “State = Upper (State)”. This calculation will help to always have the state abbreviation capitalized.
Note in Figure 1.1 the user is active in the state field and enters a state’s (South Carolina) abbreviation using lowercase. Now, note in Figure 1.2 we have tabbed out of the field. Notice how the State=Upper(State) function applied to the state field automatically corrects any and all text entered into the field to be uppercase.
I know, I know, to many calcs slows things down, right. This is an over simplification of an Auto-Calc and may not be the perfect example. For the end user, Auto-Calc’s may speed things up and make the application easier to use. In this case, the Auto-Calc helped to format the state abbreviation by capitalizing it, therefore making the company address properly formatted. A user might type “sc” for ease of entering data. With this Auto-Calc your data will be properly formatted to “SC” and when used in the correct instances.
Function Review #2: Text Formatting to Remove Multiple Font Sizes and Colors
Let’s try another example of an Auto-Enter Calculation. This time we use it to add Summary=TextFormatRemove(Self).
This Auto-Calc is useful in the event that an end user copies and pastes information from an outside source into a field within their solution. Copying and pasting text from an outside source can carry over the text formatting from original source. This results in messy, unwanted formatting and problems for the end user of your solution.
Again, we use the Invoices starter solution for this example. The Invoices Detail view provides an invoice summary field. I have added an Auto-Enter Calc, Summary = TextFormatRemove (Self), to this field.
Note the picture of the state field before and after tabbing out of the summary field.
Again, no one is suggesting over using Auto-Enter fields with calculated values. But use of Auto-Enter Calculations and functions in the correct instances can add great value to your solution. The users of your solution will never know the thought and planning of such small details you put into the solution to benefit them. What they will know is that your solutions are easy to use and are less prone to data problems.
Function Review #3: Text Formatting to Remove Colored Fonts
The function I will demonstrate here is “Summary = TextColorRemove (Self)”.
As you can see in Figure 3.1 there are multiple colors across the normal 14 point text in the invoice summary field. This makes the text hard to read. Let’s go ahead and remove the colors that are not black. We can do this by using FileMaker’s Text Functions.
After application of these functions the text was again pasted into the summary field and was returned to normal 14 point text with all color removed.
We could continue the examples with TextColor, TextFont, TextSize, TextStyleAdd and on down the line. With Auto-Enter Calculations and functions applied to the correct fields, you can add value to your solution and protect your solutions from unwanted data additions.
Many times it is not the ultra-technical tricks that make your FileMaker solution a pleasure to use. We think your FileMaker Solution users will thank you for the extra thought, polish, and attention to small details.
Used properly, they will increase your user’s experience.
Look for future posts on function reviews. I like to be an efficient, smart developer and will share with you what I’ve found helpful to me.
FileMaker 13/12 Certified Developer
The Scarpetta Group, Inc.
Like this post? Let us know. Share the functions you’ve found extremely helpful. We’ll review them in a post to share with others!