Triggering FileMaker Scripts from the Data API

Beginner

Run server-side FileMaker scripts as part of API requests using the script parameters, and handle script results in your API response.

What you'll learn

  • The three script execution phases: script, script.prerequest, script.presort
  • How to pass a parameter string to the script
  • How to read the script result from the API response
  • When to use each execution phase

Every Data API endpoint that reads or writes records accepts script execution parameters. You can run a script before the action, after the action, or after the response is prepared. This lets you enforce business logic, send notifications, or post-process data without a separate script trigger call.

1/4
1

Three script execution phases

script runs after the request action completes. script.prerequest runs before the action (useful for validation). script.presort runs after the find but before records are sorted and returned. Each phase is an independent parameter.

HTTP
// Run a validation script before creating the record,
// then a notification script after
POST /fmi/data/v1/databases/CRM/layouts/Contacts/records
?script.prerequest=ValidateContact
&script.prerequest.param=%7B%22strictMode%22%3Atrue%7D
&script=NotifyNewContact

Sign in to track your progress and pick up where you left off.

Sign in to FM Dojo