Tutorial 202:

Extend

Tutorial 202: Lesson 6

Intermediate Calculations

Lesson Materials
Download Files

Getting more from your calculations

In previous lessons in this tutorial and in Tutorial 201: Create, you’ve created some basic calculations. But you’ll be able to do much more with calculations once you get more comfortable using functions within them. Functions are predefined formulas provided by FileMaker Pro, which you can use in calculations to return a wide range of useful information. You can manipulate text, find out what device your user is on, or even make logical if/then branches, all within a calculation. 

You’ll use date functions to set up a rolling list of appointments coming up in the next week. Then you’ll write a script that uses multiple calculations to pre-populate an email template, so users can remind clients of their upcoming appointments. You’ll also use the IsEmpty() function to test whether a field contains any value, so you can choose whether to display a relevant message.

These calculations can take significant work off your users, and make scripts and layouts “smarter.”

Why is this important?

  • Functions super-charge your calculations. Use these predefined formulas and let FileMaker do the heavy lifting for you!
  • Many business rules require conditional logic: “If this, then do that; otherwise calculate this other way.” Coding this logic will make your app reflect your business, saving users from having to make those leaps on their own.

Video 1

Showing next week’s visits to users

Create a list view for visits, and a script using a calculation that will always find the upcoming week’s visits, every time it is run.

In this video, you will:

  • Use Get(CurrentDate): find the upcoming week’s visits with a “today + 6 days” calculation (2:13)
  • Go to detail view: write a script to navigate to the detail for a chosen Visit (4:12)

Video 2

Sending email reminders

Use calculations in the Send Email script step to auto-populate an email reminder with the client’s information, including the number of days until their visit.

In this video, you will:

  • Use Send Email script step: begin to write an email script (1:58)
  • Merge data: create an email template in the script with client data (2:10)
  • Use branching logic in a calculation: change the result of the calculation based on its inputs (2:51)
  • Add spacing: make long calculations more legible (5:21)
  • Hide object: show an “email sent” message only if the visit has had a reminder already (7:38)

Related Resource