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

MBS FileMaker Plugin Example Databases

Foundation Models

All examples are included with download of MBS FileMaker Plugin.

Foundation Models.fmp12

Overview
Tables 2
Relationships 0
Layouts 6
Scripts 8
Value Lists 0
Custom Functions 1
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 Script: Start
OnLastWindowClose Script: Closing
OnWindowOpen Off
OnWindowClose Off
OnFileAVPlayerChange Off
OnWindowTransaction Off
Thumbnail Settings
Generate Thumbnails On; Temporary

 

Tables

Table Name
Statistics
Comments
Occurrences in Relationship Graph
Foundation Models
9 fields defined, 0 record
Foundation Models
Summarize
7 fields defined, 1 record
Summarize

Fields

Table Name: Foundation Models - 9 Fields
Field Name Type Options Comments On Layouts In Relationships In Scripts In Value Lists
PrimaryKey Normal, Text Auto-Enter: 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
                                          Text Normal, Text Auto-Enter:
                                          • Allow editing
                                          Validation:
                                          • Only during data entry
                                          Storage:
                                          • Repetitions: 1
                                          • Indexing: None
                                          • Automatically create indexes as needed
                                          • Index Language: German
                                              IsOutput Normal, Number Auto-Enter:
                                              • Allow editing
                                              Validation:
                                              • Only during data entry
                                              Storage:
                                              • Repetitions: 1
                                              • Indexing: None
                                              • Automatically create indexes as needed
                                              • Index Language: German
                                                  Transcript Normal, Text Auto-Enter:
                                                  • Allow editing
                                                  Validation:
                                                  • Only during data entry
                                                  Storage:
                                                  • Global
                                                  • Repetitions: 1
                                                  • Index Language: German
                                                      TextReadOnly Calculated, Text Calculation: Storage:
                                                      • Repetitions: 1
                                                      • Indexing: None
                                                      • Automatically create indexes as needed
                                                      • Index Language: German

                                                            Table Name: Summarize - 7 Fields
                                                            Field Name Type Options Comments On Layouts In Relationships In Scripts In Value Lists
                                                            PrimaryKey Normal, Text Auto-Enter:
                                                            • Context table: Summarize
                                                              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
                                                                                                    Text to Summerize Normal, Text Auto-Enter:
                                                                                                    • Allow editing
                                                                                                    Validation:
                                                                                                    • Only during data entry
                                                                                                    Storage:
                                                                                                    • Repetitions: 1
                                                                                                    • Indexing: None
                                                                                                    • Automatically create indexes as needed
                                                                                                    • Index Language: German
                                                                                                        Summary 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: Foundation Models

                                                                                                            Regular Fields

                                                                                                            Field Name: Foundation Models::TextReadOnly
                                                                                                            Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                                                            • Top: 115 pt
                                                                                                            • Left: 12 pt
                                                                                                            • Bottom: 197 pt
                                                                                                            • Right: 645 pt
                                                                                                            • Anchoring: Left and Right, Top and Bottom
                                                                                                            Field Format:
                                                                                                            • Edit Box
                                                                                                            Field Behavior:
                                                                                                            • Allow field to be entered: In Browse mode
                                                                                                            • Disable visual spell-checking
                                                                                                            • Touch keyboard type: Default for Data Type
                                                                                                            • Go to next field using: Tab key
                                                                                                            Yes

                                                                                                            Field Name: Foundation Models::Text
                                                                                                            Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                                                            • Top: 115 pt
                                                                                                            • Left: 14 pt
                                                                                                            • Bottom: 146 pt
                                                                                                            • Right: 562 pt
                                                                                                            • Anchoring: Left and Right, 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: Foundation Models::Transcript
                                                                                                            Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                                                            • Top: 37 pt
                                                                                                            • Left: 439 pt
                                                                                                            • Bottom: 532 pt
                                                                                                            • Right: 866 pt
                                                                                                            • Anchoring: Left, Top
                                                                                                            Field Format:
                                                                                                            • Edit Box
                                                                                                            Field Behavior:
                                                                                                            • Allow field to be entered: In Find mode, In Browse mode
                                                                                                            • Disable visual spell-checking
                                                                                                            • Touch keyboard type: Default for Data Type
                                                                                                            • Go to next field using: Tab key
                                                                                                            No

                                                                                                            Buttons

                                                                                                            Button Properties Coordinates Script/Script Step
                                                                                                              Type:
                                                                                                            • Text: Send
                                                                                                            • Top: 115 pt
                                                                                                            • Left: 572 pt
                                                                                                            • Bottom: 146 pt
                                                                                                            • Right: 640 pt
                                                                                                            • Anchoring: Right, Bottom
                                                                                                            Perform Script [ “SendRequest” ]

                                                                                                            Scripts:


                                                                                                            Popover Buttons

                                                                                                            Popover Button Properties Coordinates
                                                                                                              Type:
                                                                                                            • Text: Transcript
                                                                                                            • Top: 33 pt
                                                                                                            • Left: 521 pt
                                                                                                            • Bottom: 88 pt
                                                                                                            • Right: 645 pt
                                                                                                            • Anchoring: Right, Top
                                                                                                            Popover Properties Coordinates
                                                                                                              Show Title Bar:
                                                                                                            • Yes
                                                                                                              Title:
                                                                                                            • "Transcript"
                                                                                                              Position:
                                                                                                            • Left
                                                                                                            • Top: 5 pt
                                                                                                            • Left: 426 pt
                                                                                                            • Bottom: 546 pt
                                                                                                            • Right: 879 pt
                                                                                                            • Anchoring: Left, Top
                                                                                                            Popover Content
                                                                                                            Tab Controls Slide Controls Fields Buttons Portals Web Viewer Controls Charts
                                                                                                                Field Objects

                                                                                                                Button Bars

                                                                                                                Button Bar Properties Coordinates
                                                                                                                  Orientation:
                                                                                                                • horizontal
                                                                                                                • Top: 69 pt
                                                                                                                • Left: 11 pt
                                                                                                                • Bottom: 100 pt
                                                                                                                • Right: 236 pt
                                                                                                                • Anchoring: Left, Top
                                                                                                                Button Segments
                                                                                                                Button Properties Coordinates Script/Script Step
                                                                                                                  Type:
                                                                                                                • Text:
                                                                                                                  Label Calculations:
                                                                                                                • "Chat"
                                                                                                                  Additional Properties:
                                                                                                                • Change to hand cursor over button
                                                                                                                • Top: 70 pt
                                                                                                                • Left: 12 pt
                                                                                                                • Bottom: 99 pt
                                                                                                                • Right: 124 pt
                                                                                                                Go to Layout [ “Foundation Models” (Foundation Models) ]

                                                                                                                Layouts:

                                                                                                                Button Properties Coordinates Script/Script Step
                                                                                                                  Type:
                                                                                                                • Text:
                                                                                                                  Label Calculations:
                                                                                                                • "Summarize"
                                                                                                                  Additional Properties:
                                                                                                                • Change to hand cursor over button
                                                                                                                • Top: 70 pt
                                                                                                                • Left: 124 pt
                                                                                                                • Bottom: 99 pt
                                                                                                                • Right: 235 pt
                                                                                                                Go to Layout [ “Summarize” (Summarize) ]

                                                                                                                Layouts:


                                                                                                                Graphic Objects

                                                                                                                Graphic Object Properties Coordinates
                                                                                                                  Type:
                                                                                                                • Rounded Rectangle
                                                                                                                • Top: 114 pt
                                                                                                                • Left: 6 pt
                                                                                                                • Bottom: 204 pt
                                                                                                                • Right: 647 pt
                                                                                                                • Anchoring: Left and Right, Top and Bottom

                                                                                                                Layout Objects: Summarize

                                                                                                                Regular Fields

                                                                                                                Field Name: Summarize::Text to Summerize
                                                                                                                Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                                                                • Top: 117 pt
                                                                                                                • Left: 110 pt
                                                                                                                • Bottom: 238 pt
                                                                                                                • Right: 680 pt
                                                                                                                • Anchoring: Left and Right, 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: Summarize::Summary
                                                                                                                Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                                                                • Top: 243 pt
                                                                                                                • Left: 110 pt
                                                                                                                • Bottom: 414 pt
                                                                                                                • Right: 680 pt
                                                                                                                • Anchoring: Left and Right, 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: Summarize
                                                                                                                • Top: 192 pt
                                                                                                                • Left: 7 pt
                                                                                                                • Bottom: 238 pt
                                                                                                                • Right: 110 pt
                                                                                                                • Anchoring: Left, Bottom
                                                                                                                Perform Script [ “Summarize” ]

                                                                                                                Scripts:


                                                                                                                Button Bars

                                                                                                                Button Bar Properties Coordinates
                                                                                                                  Orientation:
                                                                                                                • horizontal
                                                                                                                • Top: 69 pt
                                                                                                                • Left: 11 pt
                                                                                                                • Bottom: 100 pt
                                                                                                                • Right: 236 pt
                                                                                                                • Anchoring: Left, Top
                                                                                                                Button Segments
                                                                                                                Button Properties Coordinates Script/Script Step
                                                                                                                  Type:
                                                                                                                • Text:
                                                                                                                  Label Calculations:
                                                                                                                • "Chat"
                                                                                                                  Additional Properties:
                                                                                                                • Change to hand cursor over button
                                                                                                                • Top: 70 pt
                                                                                                                • Left: 12 pt
                                                                                                                • Bottom: 99 pt
                                                                                                                • Right: 124 pt
                                                                                                                Go to Layout [ “Foundation Models” (Foundation Models) ]

                                                                                                                Layouts:

                                                                                                                Button Properties Coordinates Script/Script Step
                                                                                                                  Type:
                                                                                                                • Text:
                                                                                                                  Label Calculations:
                                                                                                                • "Summarize"
                                                                                                                  Additional Properties:
                                                                                                                • Change to hand cursor over button
                                                                                                                • Top: 70 pt
                                                                                                                • Left: 124 pt
                                                                                                                • Bottom: 99 pt
                                                                                                                • Right: 235 pt
                                                                                                                Go to Layout [ “Summarize” (Summarize) ]

                                                                                                                Layouts:


                                                                                                                Script Hierarchy

                                                                                                                SendRequest
                                                                                                                Closing
                                                                                                                Start
                                                                                                                Show Transcript
                                                                                                                Show Languages
                                                                                                                Summarize
                                                                                                                Clear Summary
                                                                                                                Extract invoice

                                                                                                                Next Script: [Closing]
                                                                                                                Script Name SendRequest
                                                                                                                Run script with full access privileges Off
                                                                                                                Siri Shortcut Visible Off
                                                                                                                Include In Menu No
                                                                                                                Layouts that use this script
                                                                                                                Scripts that use this script
                                                                                                                  Script Definition
                                                                                                                  Script Steps
                                                                                                                  • Set Variable [ $text; Value:Foundation Models::Text ]
                                                                                                                  • If [ Length ( $text ) = 0 ]
                                                                                                                  • Exit Script [ ]
                                                                                                                  • End If
                                                                                                                  • Set Field [ Foundation Models::IsOutput; 1 ]
                                                                                                                  • Commit Records/Requests [ No dialog ]
                                                                                                                  • #new record for the answer
                                                                                                                  • New Record/Request
                                                                                                                  • Set Field [ Foundation Models::IsOutput; 2 ]
                                                                                                                  • #let FileMaker redraw the layout
                                                                                                                  • Pause/Resume Script [ Duration (seconds): ,2 ]
                                                                                                                  • #now ask the model for an answer, which may take a few seconds
                                                                                                                  • Set Variable [ $answer; Value:MBS("FoundationModels.Respond"; $$session; $Text) ]
                                                                                                                  • #handle the ** in the text and make it bold
                                                                                                                  • Set Variable [ $count; Value:PatternCount ( $answer ; "**" ) ]
                                                                                                                  • If [ $count > 0 ]
                                                                                                                  • Set Variable [ $inside; Value:0 ]
                                                                                                                  • Set Variable [ $index; Value:1 ]
                                                                                                                  • Set Variable [ $output; Value:"" ]
                                                                                                                  • Loop [ Flush: Defer ]
                                                                                                                  • Set Variable [ $part; Value:NthItem ( $answer ; "**" ; $index ) ]
                                                                                                                  • If [ $inside ]
                                                                                                                  • Set Variable [ $output; Value:$output & TextStyleAdd ( $part ; Bold ) ]
                                                                                                                  • Else [ ]
                                                                                                                  • Set Variable [ $output; Value:$output & $part ]
                                                                                                                  • End If
                                                                                                                  • Set Variable [ $inside; Value:not $inside ]
                                                                                                                  • Set Variable [ $index; Value:$index + 1 ]
                                                                                                                  • Exit Loop If [ $index > $count+1 ]
                                                                                                                  • End Loop
                                                                                                                  • Set Variable [ $answer; Value:$output ]
                                                                                                                  • End If
                                                                                                                  • #store answer
                                                                                                                  • Set Field [ Foundation Models::Text; $answer ]
                                                                                                                  • Commit Records/Requests [ No dialog ]
                                                                                                                  • #next input
                                                                                                                  • New Record/Request
                                                                                                                  • Go to Field [ Foundation Models::Text ] [ Select/perform ]
                                                                                                                  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: [SendRequest] Next Script: [Start]
                                                                                                                        Script Name Closing
                                                                                                                        Run script with full access privileges Off
                                                                                                                        Siri Shortcut Visible Off
                                                                                                                        Include In Menu No
                                                                                                                        Layouts that use this script
                                                                                                                          Scripts that use this script
                                                                                                                            Script Definition
                                                                                                                            Script Steps
                                                                                                                            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: [Closing] Next Script: [Show Transcript]
                                                                                                                                          Script Name Start
                                                                                                                                          Run script with full access privileges Off
                                                                                                                                          Siri Shortcut Visible Off
                                                                                                                                          Include In Menu No
                                                                                                                                          Layouts that use this script
                                                                                                                                            Scripts that use this script
                                                                                                                                              Script Definition
                                                                                                                                              Script Steps
                                                                                                                                              • Go to Layout [ “Foundation Models” (Foundation Models) ]
                                                                                                                                              • Delete All Records [ No dialog ]
                                                                                                                                              • If [ MBS("FoundationModels.Available") ≠ 1 ]
                                                                                                                                              • Exit Script [ ]
                                                                                                                                              • End If
                                                                                                                                              • Set Variable [ $$session; Value:MBS("FoundationModels.Initialize") ]
                                                                                                                                              • Set Variable [ $unavailable; Value:MBS("FoundationModels.AvailableStatus"; $$session) ]
                                                                                                                                              • If [ $unavailable = "available" ]
                                                                                                                                              • #we can use it
                                                                                                                                              • Set Variable [ $r; Value:MBS("FoundationModels.BeginSession"; $$session; "Be polite. You run as chat bot in FileMaker.") ]
                                                                                                                                              • New Record/Request
                                                                                                                                              • Else [ ]
                                                                                                                                              • Show Custom Dialog [ Title: "Available?"; Message: $unavailable; Default Button: “OK”, Commit: “Yes” ]
                                                                                                                                              • End If
                                                                                                                                              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: [Start] Next Script: [Show Languages]
                                                                                                                                                          Script Name Show Transcript
                                                                                                                                                          Run script with full access privileges Off
                                                                                                                                                          Siri Shortcut Visible Off
                                                                                                                                                          Include In Menu No
                                                                                                                                                          Layouts that use this script
                                                                                                                                                            Scripts that use this script
                                                                                                                                                              Script Definition
                                                                                                                                                              Script Steps
                                                                                                                                                              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: [Show Transcript] Next Script: [Summarize]
                                                                                                                                                                      Script Name Show Languages
                                                                                                                                                                      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
                                                                                                                                                                          • Show Custom Dialog [ Title: "Supported Languages"; Message: Substitute ( MBS("FoundationModels.SupportedLanguages"; $$session); ¶; ", " ); Default Button: “OK”, Commit: “Yes” ]
                                                                                                                                                                          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: [Show Languages] Next Script: [Clear Summary]
                                                                                                                                                                                        Script Name Summarize
                                                                                                                                                                                        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 [ $session; Value:MBS("FoundationModels.Initialize"; "General"; "PermissiveContentTransformations") ]
                                                                                                                                                                                          • Set Variable [ $r; Value:MBS("FoundationModels.BeginSession"; $session; "Summarize the following text in 100 words.") ]
                                                                                                                                                                                          • #now ask the model for an answer, which may take a few seconds
                                                                                                                                                                                          • Set Variable [ $answer; Value:MBS("FoundationModels.Respond"; $session; Summarize::Text to Summerize) ]
                                                                                                                                                                                          • #store answer
                                                                                                                                                                                          • Set Field [ Summarize::Summary; $answer ]
                                                                                                                                                                                          • Commit Records/Requests [ No dialog ]
                                                                                                                                                                                          • Set Variable [ $r; Value:MBS("FoundationModels.Release"; $session) ]
                                                                                                                                                                                          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: [Summarize] Next Script: [Extract invoice]
                                                                                                                                                                                                  Script Name Clear Summary
                                                                                                                                                                                                  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 [ Summarize::Summary; "" ]
                                                                                                                                                                                                      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: [Clear Summary]
                                                                                                                                                                                                              Script Name Extract invoice
                                                                                                                                                                                                              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 [ $session; Value:MBS("FoundationModels.Initialize"; "General"; "PermissiveContentTransformations") ]
                                                                                                                                                                                                                  • Set Variable [ $r; Value:MBS("FoundationModels.BeginSession"; $session; "The following is the text of an invoice. I need to extract the company name, the invoice date, the total of the invoice, the currency name and the invoice number. Answer only in valid JSON.") ]
                                                                                                                                                                                                                  • #now ask the model for an answer, which may take a few seconds
                                                                                                                                                                                                                  • Set Variable [ $answer; Value:MBS("FoundationModels.Respond"; $session; Summarize::Text to Summerize) ]
                                                                                                                                                                                                                  • #store answer
                                                                                                                                                                                                                  • Set Field [ Summarize::Summary; $answer ]
                                                                                                                                                                                                                  • Commit Records/Requests [ No dialog ]
                                                                                                                                                                                                                  • Set Variable [ $r; Value:MBS("FoundationModels.Release"; $session) ]
                                                                                                                                                                                                                  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

                                                                                                                                                                                                                          Custom Functions

                                                                                                                                                                                                                          Function Name Parameters Availability Definition In Field Definitions In Scripts
                                                                                                                                                                                                                          NthItem text;delimiter;itemnumber All accounts Let( [/*VARIABLES*/ start = Case ( itemnumber=1;1; Position ( text ; delimiter ; 1 ; itemnumber-1 ) + Length(delimiter) ); NumberOfDelimiters = (Length (Filter (text;delimiter))) / Length(delimiter); LengthOfItem= Case( /*if the number of delimiters in the text is equal to the itemnumber minus 1 i.e. if itemnumber is the last item in the list*/ NumberOfDelimiters = (itemnumber-1); (Length ( text ) - start) + 1; Position (text; delimiter; 1; itemnumber) - start ) ];/*CALCULATION*/ Middle ( text ; start ; LengthOfItem ) )

                                                                                                                                                                                                                            Custom Menu Sets

                                                                                                                                                                                                                            Menu Sets Menus In Scripts In Layouts Comments
                                                                                                                                                                                                                            [Standard FileMaker Menus]
                                                                                                                                                                                                                            • All Standard Menus

                                                                                                                                                                                                                            Download example: Foundation Models

                                                                                                                                                                                                                            Used functions: