Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

MBS FileMaker Plugin Example Databases

ChatGPT

All examples are included with download of MBS FileMaker Plugin.

ChatGPT.fmp12

Overview
Tables 1
Relationships 0
Layouts 1
Scripts 3
Value Lists 0
Custom Functions 0
Custom Menus 24
File Options
Default custom menu set [Standard FileMaker Menus]
Default theme Apex Blue
When opening file
Minimum allowed version 12.0
Login using Account Name; Account= Admin
Allow user to save password On
Require iOS passcode Off
Show Sign-in fields On
Switch to layout Off
Hide all toolbars Off
Script triggers
OnFirstWindowOpen Off
OnLastWindowClose Off
OnWindowOpen Off
OnWindowClose Off
OnFileAVPlayerChange Off
OnWindowTransaction Off
Thumbnail Settings
Generate Thumbnails On; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
ChatGPT
11 fields defined, 1 record
ChatGPT

Fields

Table Name: ChatGPT - 11 Fields
Field Name Type Options Comments On Layouts In Relationships In Scripts In Value Lists
PrimaryKey Normal, Text Auto-Enter:
  • Context table: ChatGPT
    Calculation: Get( UUID )
Validation:
  • Only during data entry
  • Not empty
  • Unique
  • Strict validation
Storage:
  • Repetitions: 1
  • Indexing: Minimal
  • Automatically create indexes as needed
  • Index Language: Unicode Raw
Unique identifier of each record in this table
          CreationTimestamp Normal, Timestamp Auto-Enter:
          • Creation timestamp
          Validation:
          • Only during data entry
          • Strict data type: 4 digit year
          • Not empty
          • Strict validation
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
          Date and time each record was created
                  CreatedBy Normal, Text Auto-Enter:
                  • Creation account name
                  Validation:
                  • Only during data entry
                  • Not empty
                  • Strict validation
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: German
                  Account name of the user who created each record
                          ModificationTimestamp Normal, Timestamp Auto-Enter:
                          • Modification timestamp
                          Validation:
                          • Only during data entry
                          • Strict data type: 4 digit year
                          • Not empty
                          • Strict validation
                          Storage:
                          • Repetitions: 1
                          • Indexing: None
                          • Automatically create indexes as needed
                          • Index Language: German
                          Date and time each record was last modified
                                  ModifiedBy Normal, Text Auto-Enter:
                                  • Modification account name
                                  Validation:
                                  • Only during data entry
                                  • Not empty
                                  • Strict validation
                                  Storage:
                                  • Repetitions: 1
                                  • Indexing: None
                                  • Automatically create indexes as needed
                                  • Index Language: German
                                  Account name of the user who last modified each record
                                          Query System Normal, Text Auto-Enter:
                                          • Allow editing
                                          Validation:
                                          • Only during data entry
                                          Storage:
                                          • Repetitions: 1
                                          • Indexing: None
                                          • Automatically create indexes as needed
                                          • Index Language: German
                                              Query User Normal, Text Auto-Enter:
                                              • Allow editing
                                              Validation:
                                              • Only during data entry
                                              Storage:
                                              • Repetitions: 1
                                              • Indexing: None
                                              • Automatically create indexes as needed
                                              • Index Language: German
                                                  OpenAI Organization Normal, Text Auto-Enter:
                                                  • Allow editing
                                                  Validation:
                                                  • Only during data entry
                                                  Storage:
                                                  • Global
                                                  • Repetitions: 1
                                                  • Index Language: German
                                                      Authorization Normal, Text Auto-Enter:
                                                      • Allow editing
                                                      Validation:
                                                      • Only during data entry
                                                      Storage:
                                                      • Global
                                                      • Repetitions: 1
                                                      • Index Language: German
                                                          Debug Log Normal, Text Auto-Enter:
                                                          • Allow editing
                                                          Validation:
                                                          • Only during data entry
                                                          Storage:
                                                          • Repetitions: 1
                                                          • Indexing: None
                                                          • Automatically create indexes as needed
                                                          • Index Language: German
                                                              Result Normal, Text Auto-Enter:
                                                              • Allow editing
                                                              Validation:
                                                              • Only during data entry
                                                              Storage:
                                                              • Repetitions: 1
                                                              • Indexing: None
                                                              • Automatically create indexes as needed
                                                              • Index Language: German

                                                                  Layout Objects: ChatGPT

                                                                  Regular Fields

                                                                  Field Name: ChatGPT::Query System
                                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                  • Top: 56 pt
                                                                  • Left: 138 pt
                                                                  • Bottom: 376 pt
                                                                  • Right: 496 pt
                                                                  • Anchoring: Left, Top
                                                                  Field Format:
                                                                  • Edit Box
                                                                  Field Behavior:
                                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                                  • Touch keyboard type: Default for Data Type
                                                                  • Go to next field using: Tab key
                                                                  Yes

                                                                  Field Name: ChatGPT::Query User
                                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                  • Top: 57 pt
                                                                  • Left: 611 pt
                                                                  • Bottom: 376 pt
                                                                  • Right: 969 pt
                                                                  • Anchoring: Left, Top
                                                                  Field Format:
                                                                  • Edit Box
                                                                  Field Behavior:
                                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                                  • Touch keyboard type: Default for Data Type
                                                                  • Go to next field using: Tab key
                                                                  Yes

                                                                  Field Name: ChatGPT::OpenAI Organization
                                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                  • Top: 560 pt
                                                                  • Left: 196 pt
                                                                  • Bottom: 591 pt
                                                                  • Right: 599 pt
                                                                  • Anchoring: Left, Top
                                                                  Field Format:
                                                                  • Edit Box
                                                                  Field Behavior:
                                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                                  • Touch keyboard type: Default for Data Type
                                                                  • Go to next field using: Tab key
                                                                  No

                                                                  Field Name: ChatGPT::Authorization
                                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                  • Top: 595 pt
                                                                  • Left: 196 pt
                                                                  • Bottom: 626 pt
                                                                  • Right: 599 pt
                                                                  • Anchoring: Left, Top
                                                                  Field Format:
                                                                  • Edit Box
                                                                  Field Behavior:
                                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                                  • Touch keyboard type: Default for Data Type
                                                                  • Go to next field using: Tab key
                                                                  No

                                                                  Field Name: ChatGPT::Debug Log
                                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                  • Top: 386 pt
                                                                  • Left: 611 pt
                                                                  • Bottom: 543 pt
                                                                  • Right: 969 pt
                                                                  • Anchoring: Left, Top and Bottom
                                                                  Field Format:
                                                                  • Edit Box
                                                                  Field Behavior:
                                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                                  • Touch keyboard type: Default for Data Type
                                                                  • Go to next field using: Tab key
                                                                  Yes

                                                                  Field Name: ChatGPT::Result
                                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                  • Top: 386 pt
                                                                  • Left: 138 pt
                                                                  • Bottom: 543 pt
                                                                  • Right: 496 pt
                                                                  • Anchoring: Left, Top and Bottom
                                                                  Field Format:
                                                                  • Edit Box
                                                                  Field Behavior:
                                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                                  • Touch keyboard type: Default for Data Type
                                                                  • Go to next field using: Tab key
                                                                  Yes

                                                                  Buttons

                                                                  Button Properties Coordinates Script/Script Step
                                                                    Type:
                                                                  • Text: Run Query
                                                                    Additional Properties:
                                                                  • Change to hand cursor over button
                                                                  • Top: 100 pt
                                                                  • Left: 501 pt
                                                                  • Bottom: 146 pt
                                                                  • Right: 606 pt
                                                                  • Anchoring: Left, Top
                                                                  Perform Script [ “Run Query” ]

                                                                  Scripts:


                                                                  Script Hierarchy

                                                                  Run Query
                                                                  Finished
                                                                  Clear

                                                                  Next Script: [Finished]
                                                                  Script Name Run Query
                                                                  Run script with full access privileges Off
                                                                  Siri Shortcut Visible Off
                                                                  Include In Menu Yes
                                                                  Layouts that use this script
                                                                  Scripts that use this script
                                                                    Script Definition
                                                                    Script Steps
                                                                    • Set Variable [ $curl; Value:MBS("CURL.New") ]
                                                                    • Set Variable [ $json; Value:JSONSetElement ( "{}" ; ["model" ; "gpt-4o-mini" ; JSONString]; ["max_tokens" ; 100 ; JSONNumber]; ["messages.[0].role"; "system"; JSONString]; ["messages.[0].content"; ChatGPT::Query System; JSONString]; ["messages.[1].role"; "user"; JSONString]; ["messages.[1].content"; ChatGPT::Query User; JSONString]) ]
                                                                    • Set Variable [ $result; Value:MBS("CURL.SetOptionPostFields"; $curl; $json) ]
                                                                    • Set Variable [ $result; Value:MBS( "CURL.SetOptionHTTPHeader"; $curl; "OpenAI-Organization: " & ChatGPT::OpenAI Organization; "Authorization: Bearer " & ChatGPT::Authorization; "Content-Type: application/json" ) ]
                                                                    • Set Variable [ $result; Value:MBS("CURL.SetOptionURL"; $curl; "https://api.openai.com/v1/chat/completions") ]
                                                                    • Set Variable [ $result; Value:MBS("CURL.SetFinishedScript"; $curl; Get(FileName); "Finished") ]
                                                                    • Set Variable [ $result; Value:MBS("CURL.PerformInBackground"; $curl) ]
                                                                    Fields used in this script
                                                                    Scripts used in this script
                                                                      Layouts used in this script
                                                                        Tables used in this script
                                                                        Table occurrences used by this script
                                                                        Custom Functions used by this script
                                                                          Custom menu set used by this script

                                                                            Previous Script: [Run Query] Next Script: [Clear]
                                                                            Script Name Finished
                                                                            Run script with full access privileges Off
                                                                            Siri Shortcut Visible Off
                                                                            Include In Menu Yes
                                                                            Layouts that use this script
                                                                              Scripts that use this script
                                                                                Script Definition
                                                                                Script Steps
                                                                                • Set Variable [ $curl; Value:Get(ScriptParameter) ]
                                                                                • Set Variable [ $debug; Value:MBS("CURL.GetDebugMessages"; $curl; "UTF-8") ]
                                                                                • Set Variable [ $result; Value:MBS("CURL.GetResultAsText"; $curl; "UTF-8") ]
                                                                                • Set Field [ ChatGPT::Debug Log; $debug ]
                                                                                • Set Field [ ChatGPT::Result; $result ]
                                                                                • Set Variable [ $text; Value:JSONGetElement ( ChatGPT::Result ; "choices[0].message.content" ) ]
                                                                                • If [ Length ( $text ) > 0 ]
                                                                                • Set Field [ ChatGPT::Result; $text ]
                                                                                • End If
                                                                                • Set Variable [ $r; Value:MBS("CURL.Release"; $curl) ]
                                                                                Fields used in this script
                                                                                Scripts used in this script
                                                                                  Layouts used in this script
                                                                                    Tables used in this script
                                                                                    Table occurrences used by this script
                                                                                    Custom Functions used by this script
                                                                                      Custom menu set used by this script

                                                                                        Previous Script: [Finished]
                                                                                        Script Name Clear
                                                                                        Run script with full access privileges Off
                                                                                        Siri Shortcut Visible Off
                                                                                        Include In Menu Yes
                                                                                        Layouts that use this script
                                                                                          Scripts that use this script
                                                                                            Script Definition
                                                                                            Script Steps
                                                                                            • Set Field [ ChatGPT::Debug Log; "" ]
                                                                                            • Set Field [ ChatGPT::Result; "" ]
                                                                                            Fields used in this script
                                                                                            Scripts used in this script
                                                                                              Layouts used in this script
                                                                                                Tables used in this script
                                                                                                Table occurrences used by this script
                                                                                                Custom Functions used by this script
                                                                                                  Custom menu set used by this script

                                                                                                    Download example: ChatGPT

                                                                                                    Used functions: