proofchat

Navigation Script Hooks

Edit configuration scripts so ProofChat can navigate back into your solution.

Summary

  • Purpose: Enable round-trip navigation from ProofChat to target layouts/records
  • Audience: Integrators
  • Prereqs: /docs/integration/

Steps

  1. Open the FileMaker Script Workspace.
  2. In ProofChat Integration → Configuration → Required, edit the script named Configure Navigate To Record.
  3. In the step Set Variable [$layoutName; Value: …], click Specify… and edit the Case( ) mapping that translates a table name to a layout name.
  4. Map table names to layout names (e.g., products → "ProductView", customers → "CustomerView"). Keep mappings on a single Case( ) for easy maintenance.
  5. Keep the rest of the script as‑is; it handles window selection, opening the layout, and navigating to the requested record index.
  6. Save the script.

Window selection in your file

The script includes a step that selects your main application window by name. If your primary window is not named "Main", change the Select Window step to match your window name.

# you may need to change this to select your Main application's window
Select Window [ Name: "Main" ; Current file ]

If the specified window is not found, the script opens a new one automatically.

Example mapping

Case(
  $tableName = "products";   "ProductView";
  $tableName = "customers";  "CustomerView";
  $tableName = "contacts";   "ContactView";
  $tableName = "invoices";   "InvoiceView";
  "" // fallback: empty triggers the "No Layout" dialog
)

What this looks like

Configure Navigate To Record script mapping tables to layouts

How to test it

To verify navigation works end‑to‑end, trigger it from the chat UI (not by running the script manually):

  1. In Chat, ask a question that uses the Query Database tool for one of your mapped tables (e.g., "Show the latest invoices").
  2. When the result renders as a data visualization table or a FileMaker record custom component, click a row or the record link.
  3. ProofChat will call Configure Navigate To Record with the table name and record identifiers, switch to your file, and open the mapped layout at the selected record.
  4. If the table isn't mapped or the mapping returns an empty layout, you'll see the "No Layout" dialog from the script.

Advanced customizations

This script is yours to tailor. Beyond a simple table→layout mapping, you can:

  • Route different users to different layouts based on privilege set, account name, or any condition.
  • Send different categories of records to different layouts (e.g., inventory vs. service items).
  • Apply business rules before navigating (e.g., open in a new window, show a warning, or log access).
  • Derive the destination layout dynamically from the record, settings table, or conventions.

Goal: ensure the user lands on the layout you intend for the record they clicked in the chat UI. The script receives the table name, record ID(s), and the selected record index as parameters, so you have the context you need.

Because configuration scripts belong to your solution, you can modify them safely. See ownership details: /docs/concepts/configuration-scripts-ownership.