VOOZH about

URL: https://www.cdata.com/kb/tech/xml-odbc-filemaker-pro.rst

⇱ Connect to XML Data in Claris FileMaker Pro


Connect to XML Data in Claris FileMaker Pro

πŸ‘ Dibyendu Datta
Dibyendu Datta
Lead Technology Evangelist
Use the CData ODBC Driver for XML in FileMaker Pro to connect to XML and work with XML data in your FileMaker applications.

Claris FileMaker is a low-code database application development tool that allows users to create custom apps for managing and organizing data. It combines a powerful relational database engine with an intuitive interface, enabling both technical and non-technical users to design and deploy applications across desktop, web, and mobile platforms.

In this article, we'll explore how to use the CData ODBC Driver for XML in FileMaker to connect to XML data.

Create an ODBC Data Source for XML

If you have not already, first specify connection properties in an ODBC DSN (data source name). This is the last step of the driver installation. You can use the Microsoft ODBC Data Source Administrator to create and configure ODBC DSNs.

Connecting to Local or Cloud-Stored (Box, Google Drive, Amazon S3, SharePoint) XML Files

CData Drivers let you work with XML files stored locally and stored in cloud storage services like Box, Amazon S3, Google Drive, or SharePoint, right where they are.

Setting connection properties for local files

Set the URI property to local folder path.

Setting connection properties for files stored in Amazon S3

To connect to XML file(s) within Amazon S3, set the URI property to the URI of the Bucket and Folder where the intended XML files exist. In addition, at least set these properties:

  • AWSAccessKey: AWS Access Key (username)
  • AWSSecretKey: AWS Secret Key

Setting connection properties for files stored in Box

To connect to XML file(s) within Box, set the URI property to the URI of the folder that includes the intended XML file(s). Use the OAuth authentication method to connect to Box.

Dropbox

To connect to XML file(s) within Dropbox, set the URI proprerty to the URI of the folder that includes the intended XML file(s). Use the OAuth authentication method to connect to Dropbox. Either User Account or Service Account can be used to authenticate.

SharePoint Online (SOAP)

To connect to XML file(s) within SharePoint with SOAP Schema, set the URI proprerty to the URI of the document library that includes the intended XML file. Set User, Password, and StorageBaseURL.

SharePoint Online REST

To connect to XML file(s) within SharePoint with REST Schema, set the URI proprerty to the URI of the document library that includes the intended XML file. StorageBaseURL is optional. If not set, the driver will use the root drive. OAuth is used to authenticate.

Google Drive

To connect to XML file(s) within Google Drive, set the URI property to the URI of the folder that includes the intended XML file(s). Use the OAuth authentication method to connect and set InitiateOAuth to GETANDREFRESH.

The property is the controlling property over how your data is represented into tables and toggles the following basic configurations.

  • Document (default): Model a top-level, document view of your XML data. The data provider returns nested elements as aggregates of data.
  • FlattenedDocuments: Implicitly join nested documents and their parents into a single table.
  • Relational: Return individual, related tables from hierarchical data. The tables contain a primary key and a foreign key that links to the parent document.

See the Modeling XML Data chapter for more information on configuring the relational representation. You will also find the sample data used in the following examples. The data includes entries for people, the cars they own, and various maintenance services performed on those cars.

When you configure the DSN, you may also want to set the Max Rows connection property. This will limit the number of rows returned, which is especially helpful for improving performance when designing reports and visualizations.

Connect and sync XML data with FileMaker using the CData ODBC Driver for XML

Once you configure the CData ODBC Driver for XML, you can connect to live XML data in FileMaker and use it in your applications. In this section, we'll walk through the steps to connect live XML data to FileMaker.

You can download and install the latest version of FileMaker Pro for your Mac/Windows/Linux systems here: https://www.claris.com/resources/downloads/.

Importing XML data using FileMaker's ODBC Import Function

Follow the steps below to easily import XML data using the ODBC import feature:

  1. Open FileMaker Pro. Navigate to Create from the left panel and select Blank > Create.
  2. πŸ‘ Create a new application in FileMaker
  3. Enter a desired filename and click Save.
  4. In the Manage Database window, go to the Tables tab and create or rename the table where you want to display XML data.
  5. πŸ‘ Create or edit a table.
  6. In the Fields tab, add the required fields to the table.
  7. πŸ‘ Create the fields for the table.
  8. In the Relationships tab, define table relationships if your database has multiple tables, then click OK.
  9. To reopen and modify the table structure later, go to File > Manage > Database.
  10. To import XML data via the CData ODBC Driver for XML, navigate to File > Import Records > ODBC Data Source.
  11. πŸ‘ Select ODBC Data Source from Import Records.
  12. In the Select ODBC Data Source window, choose CData ODBC Driver for XML and click Create. Enter your XML username and password, then click OK.
  13. πŸ‘ Select CData XML Sys.
    πŸ‘ Enter the XML username and password.
  14. In the SQL Query Builder window, select the desired table from the Tables section and choose the relevant columns from the Columns section. Click Insert into SQL Query after each selection to automatically generate a query that retrieves data from XML. You can also manually edit the query using WHERE and ORDER BY clauses or use the tabs provided in the SQL Query Builder. Click Execute to run the query.
  15. πŸ‘ Choose the columns to generate the SQL Query.
  16. In the Specify Import Order window, define the import order for the target fields. Select Add between source and target to add new records to the target table from the selected fields. Click Import.
  17. πŸ‘ Specify the import order.

You have now successfully imported XML data into FileMaker Pro using the CData ODBC Driver for XML. To perform incremental updates, change the import order to "Update" or use "Replace" based on your use case.

Process XML data at design time

You can sort and aggregate data, as well as calculate summary functions while browsing tables. To manipulate the view of data at design time, complete the following steps:

  • Switch to Preview Mode: Click the Preview at the top to check how the XML data with look before you print it.
  • Switch to Table View: Click the table icon in the View As menu in the main toolbar of the application.
πŸ‘ The XML data is displayed in FileMaker Pro.

Aggregate and summarize

Follow the steps below to group column values and display summaries, as shown in the screenshot:

  • Sort: Click the arrow in the NumberOfEmployees column header and choose Sort Ascending from the menu.
  • Group: In the same menu, click Add Trailing Group by Industry to group the values and insert a summary row. Alternatively, click Add Leading Group to add a summary row at the beginning.
  • Summarize: Select a summary option from the Trailing Subtotals menu for a grouped column.
πŸ‘ Select the Trailing Subtotals.

Create a bar chart

Use the following steps to create a simple bar chart showing the total NumberOfEmployees for each Industry:

  1. Click the arrow in the NumberOfEmployees column header and select Chart by NumberOfEmployees.
    • If you've already grouped the table by a column (e.g., Industry), you can chart NumberOfEmployees by that column.
    πŸ‘ Create the chart from XML data.
  2. In the Chart Setup window:
    • Click the button next to the Data box to add the x-axis column.
    • Choose the appropriate column in the dialog that appears.
    • For the y-axis, select a summary option from the Summary menu.
πŸ‘ The chart is displayed based on the inputs given.

Get Started Today

Download a free 30-day trial of the CData ODBC Driver for XML to integrate XML data into Claris FileMaker and work with XML data in your FileMaker applications.

Reach out to our Support Team if you have any questions.

Ready to get started?

Download a free trial of the XML ODBC Driver to get started:

 Download Now

Learn more:

πŸ‘ XML Documents Icon
XML ODBC Driver

The XML ODBC Driver is a powerful tool that allows you to connect with live XML data stores, directly from any applications that support ODBC connectivity.

Access XML data like you would any standard database - read, write, and update etc. through a standard ODBC Driver interface.