Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

What is the simplest way to export a found set of related records as a CSV file (using Export Field Contents script step) that includes a custom header row?

What exactly is included in "custom header row"?

 

---

Actually, upon re-reading your question, I find I don't understand it at all. There is no such thing as "a found set of related records". You always export records in the found set of the current table - and you can optionally include fields from related records in the export. And what does the Export Field Contents script step have to do with exporting a set of records?

Edited by comment

With FM 13 you can use a calculation field and then new List Of Summary function and to generate a quoted and comma separated list then export the contents of this field.

 

You can also use Execute SQL to populate a global field to export out and add in the column header row and all the contents - (however Execute SQL, may require a bit more to isolate your found set - or rather your query may need to isolate your records - as SQL has no concept of found sets )

 

Just be aware that using Export Field Contents will encode the file as UTF-16 where as standard exports as CSV will export as UTF-8. So there could be some issues if you are uploading this file to a third party.

 

Another thing you can do is to use a variable to export records as MERGE FILE FORMAT and just append the ".csv" extension this will allow you to include the column headers (field names)

 

The other option is to use ScriptMaster (plugin) to allow you to write a file to the desktop where you can get data written out from a field or variable and will allow you to keep the encoding as UTF-8.

  • 2 months later...

This request is actually more common than you would think. FileMaker always exports field names as the column headers for exported data. This is also true when records are saved as Excel. This is inconvenient for any developer that uses a field naming convention that is not easily understood by the users of the solution.

 

I currently use FileMaker's ExecuteSQL script step to first generate the data set with a custom header row and then export the data to a .csv file.  Opening the resulting data file in MS Excel is a simple 3-click process. This developer must define the header row and append the query result to the custom header row.

 

Refer to FileMaker's SQL Guide for information on how to properly build an SQL Query within your database solution.

 

- Charlie

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.