Back to Blog
2025-12-11 8 min read

Architecting AI Integrations in FileMaker: 3 Use Cases to Enhance your FileMaker System

The AI Opportunity for FileMaker Developers

Artificial Intelligence is reshaping software, but its value is often obscured by hype. For FileMaker developers, the opportunity is not about replacing the platform; it's about augmenting it. Our core strength is building robust systems for structured data. AI's strength is processing unstructured data--text, images, and complex patterns. By combining the two, we can build applications that are vastly more capable than the sum of their parts.

FileMaker 20 provides the essential tools to make this integration seamless and scalable. The architectural pattern is straightforward: treat FileMaker as the persistent data hub and the AI model as a specialized, on-demand processing engine. We send data out for analysis or generation and bring the structured results back into our database.

This article explores three practical, high-value use cases for this pattern, focusing on the "why" before the "how."

The Core Integration Pattern: cURL and JSON

The foundation of any modern API integration in FileMaker is the Insert from URL script step, configured with cURL options, and the native JSON function suite.

  1. Construct the Request: We use JSONSetElement to build the body of our API request. This typically includes the AI model we want to use and the prompt or data we're sending.
  2. Send the Request: We use Insert from URL to send the request to the AI service's endpoint. The API key is passed securely in the cURL headers, not in the URL itself.
  3. Parse the Response: The AI service returns a JSON object. We use JSONGetElement to extract the specific pieces of information we need--the generated text, the classification, or the extracted data.

FileMaker 20's enhancements, particularly the Perform Script on Server with Callback option, make this pattern more powerful by allowing these potentially slow API calls to run asynchronously, preventing a locked user interface.

Use Case 1: Natural Language Data Entry

The Problem: Standard data entry forms are efficient but can feel rigid. For tasks like creating a new contact or logging a quick note, users often prefer a more conversational interface.

The Architectural Solution: We can use an AI model to parse unstructured text into structured JSON that FileMaker can easily digest.

Imagine a single text field where a user can type: "Log a meeting with Jane Doe from Acme Inc. tomorrow at 2pm about the Q4 proposal."

A script, triggered by a button, sends this text to an AI model (like OpenAI's GPT-4) with a carefully crafted system prompt.

The Prompt: The key is telling the model exactly what you want.

"You are a data extraction assistant for a CRM. Analyze the user's text and return a JSON object with the following keys: contactName, companyName, meetingDate (in YYYY-MM-DD format), meetingTime (in HH:MM format), and topic. The current date is [current date]."

The Script Logic:

  1. Define the API endpoint, your secret API key, and the user's input text in variables.
  2. Construct the JSON payload for the API call.
# Let's assume $promptText contains the user's input.

Set Variable [ $jsonPayload ; Value: JSONSetElement ( "" ;
  [ "model" ; "gpt-4-turbo" ; JSONString ] ;
  [ "response_format" ; JSONSetElement ( "" ; "type" ; "json_object" ; JSONString ) ; JSONObject ] ;
  [ "messages" ; JSONSetElement ( "[]" ;
    [ 0 ; JSONSetElement ( "" ; [ "role" ; "system" ; JSONString ] ; [ "content" ; "You are a data extraction assistant..." ; JSONString ] ) ; JSONObject ] ;
    [ 1 ; JSONSetElement ( "" ; [ "role" ; "user" ; JSONString ] ; [ "content" ; $promptText ; JSONString ] ) ; JSONObject ]
  ) ; JSONArray ]
) ]
  1. Configure the cURL options for the Insert from URL step.
# Store your API Key securely, not hard-coded like this.
Set Variable [ $apiKey ; Value: "sk-YourSecretKey" ]

Set Variable [ $curlOptions ; Value:
  "--request POST " &
  "--header \"Content-Type: application/json\" " &
  "--header \"Authorization: Bearer " & $apiKey & "\" " &
  "--data @$jsonPayload"
]
  1. Call the API and capture the result in a variable, say $apiResult.
  2. Parse the JSON response to create new records.
# The API returns a JSON object. We need to get the actual content.
Set Variable [ $extractedData ; Value: JSONGetElement ( $apiResult ; "choices[0].message.content" ) ]

New Window [ ... ]
Go to Layout [ "Meetings" ]
New Record/Request
Set Field [ Meetings::Topic ; JSONGetElement ( $extractedData ; "topic" ) ]
Set Field [ Meetings::Date ; JSONGetElement ( $extractedData ; "meetingDate" ) ]
# ...and so on for other fields...

This turns a multi-field data entry chore into a single, fluid action for the user.

Use Case 2: Content Summarization and Keyword Extraction

The Problem: Your solution stores large blocks of text--support tickets, project notes, research articles. Finding relevant information quickly is difficult, and full-text search can be noisy.

The Architectural Solution: On record commit or via a user-triggered script, send the text to an AI model to generate a concise summary and a list of relevant keywords. These are then stored in their own dedicated fields.

This has two major benefits:

  • Discoverability: Users can quickly grasp the essence of a record without reading the entire text.
  • Searchability: The extracted keywords provide a highly relevant, curated index for searching and reporting.

The implementation is very similar to the first use case, but the prompt changes.

The Prompt:

"Analyze the following text. Provide a 2-3 sentence summary. Also, provide a comma-separated list of 5-7 relevant keywords. Return a JSON object with two keys: summary and keywords."

This process is ideally suited for a server-side script (Perform Script on Server) to avoid delaying the user's workflow.

Use Case 3: Sentiment Analysis

The Problem: You have a table of customer feedback, survey responses, or product reviews. How do you quantify sentiment to track trends over time?

The Architectural Solution: Use an AI to classify each piece of feedback. This transforms subjective text into a measurable data point.

A script can loop through records, sending the feedback text to an AI model with a simple classification prompt.

The Prompt:

"Classify the sentiment of the following text as 'Positive', 'Negative', or 'Neutral'. Return only one of those three words."

The script would then take the single-word response and populate a Sentiment field in the Feedback table. Once you have this structured data point, you can build powerful dashboard widgets, charts, and reports to answer questions like:

  • "What is our overall customer satisfaction score this month?"
  • "Show me all negative feedback related to 'shipping'."

Architectural Best Practices and Trade-offs

Integrating external services requires careful consideration.

Cost Management

API calls cost money. Do not trigger an API call on every keystroke. Use explicit triggers like a button click or an on-commit script trigger for a specific field. For batch processing, provide a clear interface for the user to initiate the process on a found set of records.

Latency and User Experience

AI models can take several seconds to respond. Never run an API call directly in a user-facing script without providing feedback. The best practice is to use Perform Script on Server with Callback. This offloads the wait to the server and runs a secondary script (the "callback") to update the record once the API responds, leaving the user free to continue their work.

Security

Your API key is a secret. Do not store it directly in a script. A common practice is to store it in a record in a dedicated Preferences or Configuration table with a privilege set that restricts access to only server-side scripts or full-access accounts.

Error Handling

The API service could be down, your request might be malformed, or you might exceed your rate limit. Your scripts must account for this. Always check for errors after the Insert from URL step and log them appropriately.

Insert from URL [ Select ; With dialog: Off ; Target: $apiResult ; ... ]

If [ Get ( LastError ) ≠ 0 ]
  # Handle the cURL-level error (e.g., no network connection)
  Exit Script [ Text Result: "Error: " & Get ( LastError ) ]
Else
  # Check for an API-level error in the JSON response
  Set Variable [ $error ; Value: JSONGetElement ( $apiResult ; "error" ) ]
  If [ $error ≠ "" ]
    # Handle the error returned by the AI service
    Exit Script [ Text Result: "API Error: " & $error ]
  End If
End If

Conclusion

FileMaker 20 doesn't have a built-in "AI button." It has something much more powerful: the architectural components to integrate with any AI service. By understanding the pattern of sending data via cURL and parsing the returned JSON, you can build smarter, more intuitive applications. The key is to move beyond the novelty and identify practical business problems--like streamlining data entry, improving search, or analyzing feedback--that this powerful new category of tools can help you solve.

Further Reading

Need help tracking all your prompts? I built a git-like website to manage your system prompts. The Prompt Vault - Free to Sign up.

Run a free analysis on your prompt with my AI-Judge. Just provide a gemini API Key. AI Judge.

Architecting AI Integrations in FileMaker: 3 Use Cases to Enhance your FileMaker System | Jeffrey Henry