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

MBS FileMaker Plugin Example Databases

Query IP and Country

All examples are included with download of MBS FileMaker Plugin.

Query IP and Country.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts1
Value Lists0
Custom Functions0
Custom Menus33
File Options
Default custom menu set[Standard FileMaker Menus]
When opening file
Minimum allowed version12.0
Login usingAccount Name; Account= Admin
Allow user to save passwordOff
Require iOS passcodeOff
Switch to layoutOff
Hide all toolbarsOff
Script triggers
OnFirstWindowOpenOff
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
Table
9 fields defined, 0 record
Table

Fields

Table Name: Table - 9 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
IPNormal, TextAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: None
  • Automatically create indexes as needed
  • Index Language: German
      HostnameNormal, TextAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
      • Indexing: None
      • Automatically create indexes as needed
      • Index Language: German
          CityNormal, TextAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
              RegionNormal, TextAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1
              • Indexing: None
              • Automatically create indexes as needed
              • Index Language: German
                  CountryNormal, TextAuto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: German
                      LocationNormal, TextAuto-Enter:
                      • Allow editing
                      Validation:
                      • Only during data entry
                      Storage:
                      • Repetitions: 1
                      • Indexing: None
                      • Automatically create indexes as needed
                      • Index Language: German
                          Company or ProviderNormal, TextAuto-Enter:
                          • Allow editing
                          Validation:
                          • Only during data entry
                          Storage:
                          • Repetitions: 1
                          • Indexing: None
                          • Automatically create indexes as needed
                          • Index Language: German
                              DebugLogNormal, TextAuto-Enter:
                              • Allow editing
                              Validation:
                              • Only during data entry
                              Storage:
                              • Repetitions: 1
                              • Indexing: None
                              • Automatically create indexes as needed
                              • Index Language: German
                                  ResultNormal, TextAuto-Enter:
                                  • Allow editing
                                  Validation:
                                  • Only during data entry
                                  Storage:
                                  • Repetitions: 1
                                  • Indexing: None
                                  • Automatically create indexes as needed
                                  • Index Language: German

                                      Layout Objects: Table

                                      Regular Fields

                                      Field Name: Table::IP
                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                      • Top: 42 pt
                                      • Left: 138 pt
                                      • Bottom: 56 pt
                                      • Right: 391 pt
                                      • Anchoring: Left, Top
                                      Field Format:
                                      • Edit Box
                                      Field Behavior:
                                      • Allow field to be entered: In Find mode, In Browse mode
                                      • Touch keyboard type: System Default
                                      • Go to next field using: Tab key
                                      Yes

                                      Field Name: Table::Hostname
                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                      • Top: 60 pt
                                      • Left: 138 pt
                                      • Bottom: 74 pt
                                      • Right: 391 pt
                                      • Anchoring: Left, Top
                                      Field Format:
                                      • Edit Box
                                      Field Behavior:
                                      • Allow field to be entered: In Find mode, In Browse mode
                                      • Touch keyboard type: System Default
                                      • Go to next field using: Tab key
                                      Yes

                                      Field Name: Table::City
                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                      • Top: 78 pt
                                      • Left: 138 pt
                                      • Bottom: 92 pt
                                      • Right: 391 pt
                                      • Anchoring: Left, Top
                                      Field Format:
                                      • Edit Box
                                      Field Behavior:
                                      • Allow field to be entered: In Find mode, In Browse mode
                                      • Touch keyboard type: System Default
                                      • Go to next field using: Tab key
                                      Yes

                                      Field Name: Table::Region
                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                      • Top: 96 pt
                                      • Left: 138 pt
                                      • Bottom: 110 pt
                                      • Right: 391 pt
                                      • Anchoring: Left, Top
                                      Field Format:
                                      • Edit Box
                                      Field Behavior:
                                      • Allow field to be entered: In Find mode, In Browse mode
                                      • Touch keyboard type: System Default
                                      • Go to next field using: Tab key
                                      Yes

                                      Field Name: Table::Country
                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                      • Top: 114 pt
                                      • Left: 138 pt
                                      • Bottom: 128 pt
                                      • Right: 391 pt
                                      • Anchoring: Left, Top
                                      Field Format:
                                      • Edit Box
                                      Field Behavior:
                                      • Allow field to be entered: In Find mode, In Browse mode
                                      • Touch keyboard type: System Default
                                      • Go to next field using: Tab key
                                      Yes

                                      Field Name: Table::Location
                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                      • Top: 132 pt
                                      • Left: 138 pt
                                      • Bottom: 146 pt
                                      • Right: 391 pt
                                      • Anchoring: Left, Top
                                      Field Format:
                                      • Edit Box
                                      Field Behavior:
                                      • Allow field to be entered: In Find mode, In Browse mode
                                      • Touch keyboard type: System Default
                                      • Go to next field using: Tab key
                                      Yes

                                      Field Name: Table::Company or Provider
                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                      • Top: 150 pt
                                      • Left: 138 pt
                                      • Bottom: 164 pt
                                      • Right: 391 pt
                                      • Anchoring: Left, Top
                                      Field Format:
                                      • Edit Box
                                      Field Behavior:
                                      • Allow field to be entered: In Find mode, In Browse mode
                                      • Touch keyboard type: System Default
                                      • Go to next field using: Tab key
                                      Yes

                                      Field Name: Table::DebugLog
                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                      • Top: 60 pt
                                      • Left: 666 pt
                                      • Bottom: 266 pt
                                      • Right: 919 pt
                                      • Anchoring: Left, Top
                                      Field Format:
                                      • Edit Box
                                      Field Behavior:
                                      • Allow field to be entered: In Find mode, In Browse mode
                                      • Touch keyboard type: System Default
                                      • Go to next field using: Tab key
                                      Yes

                                      Field Name: Table::Result
                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                      • Top: 60 pt
                                      • Left: 414 pt
                                      • Bottom: 266 pt
                                      • Right: 655 pt
                                      • Anchoring: Left, Top
                                      Field Format:
                                      • Edit Box
                                      Field Behavior:
                                      • Allow field to be entered: In Find mode, In Browse mode
                                      • Touch keyboard type: System Default
                                      • Go to next field using: Tab key
                                      Yes

                                      Group Buttons

                                      Button PropertiesCoordinatesScript/Script Step
                                        Type:
                                      • Text: Query IP
                                        Additional Properties:
                                      • Change to hand cursor over button
                                      • Rectangular
                                      • Top: 6 pt
                                      • Left: 66 pt
                                      • Bottom: 31 pt
                                      • Right: 193 pt
                                      • Anchoring: Left, Top
                                      Perform Script [ “Query” ]

                                      Scripts:


                                      Script Hierarchy

                                      Query

                                      Script NameQuery
                                      Run script with full access privilegesOff
                                      Include In MenuYes
                                      Layouts that use this script
                                      Scripts that use this script
                                        Script Definition
                                        Script Steps
                                        • Go to Layout [ “Table” ]
                                        • New Record/Request
                                        • #Start new session
                                        • Set Variable [ $curl; Value:MBS("CURL.New") ]
                                        • #Set URL to load (HTTP, HTTPS, FTP, FTPS, SFTP, etc.)
                                        • Set Variable [ $result; Value:MBS("CURL.SetOptionURL"; $curl; "http://ipinfo.io") ]
                                        • #RUN now
                                        • Set Variable [ $result; Value:MBS("CURL.Perform"; $curl) ]
                                        • #Check result
                                        • Set Field [ Table::DebugLog; MBS("CURL.GetDebugMessages"; $curl) ]
                                        • Set Field [ Table::Result; MBS("CURL.GetResultAsText"; $curl; "UTF8") ]
                                        • If [ $result = "OK" ]
                                        • #Check HTTP error code
                                        • Set Variable [ $response; Value:MBS("CURL.GetResponseCode"; $curl) ]
                                        • If [ $response = 200 ]
                                        • #Query values from JSON
                                        • Set Variable [ $json; Value:MBS( "JSON.Parse"; Table::Result ) ]
                                        • Set Field [ Table::IP; MBS("JSON.GetPathItem"; $json; "ip"; 1) ]
                                        • Set Field [ Table::Hostname; MBS("JSON.GetPathItem"; $json; "hostname"; 1) ]
                                        • Set Field [ Table::City; MBS("JSON.GetPathItem"; $json; "city"; 1) ]
                                        • Set Field [ Table::Region; MBS("JSON.GetPathItem"; $json; "region"; 1) ]
                                        • Set Field [ Table::Country; MBS("JSON.GetPathItem"; $json; "country"; 1) ]
                                        • Set Field [ Table::Location; MBS("JSON.GetPathItem"; $json; "loc"; 1) ]
                                        • Set Field [ Table::Company or Provider; MBS("JSON.GetPathItem"; $json; "org"; 1) ]
                                        • Set Variable [ $r; Value:MBS( "JSON.Release"; $json ) ]
                                        • End If
                                        • End If
                                        • #Cleanup
                                        • Set Variable [ $result; Value:MBS("CURL.Cleanup"; $curl) ]
                                        • Commit Records/Requests [ No dialog ]
                                        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: Query IP and Country

                                              Used functions: