Brian Dunning's FileMaker Custom Functions

ListFieldsFromTable ( TableOccurrenceName )

Returns a sorted list of all Field Names for specified Table Occurrence in the current FileMaker Pro v12 file (Table Occurrence can reference external files)

  Average rating: 4.3 (36 votes) Log in to vote

Andrew Duncan   Andrew Duncan
Databuzz
https://www.databuzz.com.au

Share on Facebook Share on Twitter

  Sample input:
ListFieldsFromTable ( "Contacts" )
  Sample output:
CONTACT ID MATCHING FIELD
Company
Contact Name
Contact Name Labels
Fax
First
Group
Home Address 1
Home Address 2
Home City
Home Country
Home Email
Home Phone
Home Postal Code
Home State
IM
Initial
Job Title
Last
Location GPS | iOS
Map from URL | Container
Mobile Phone
Notes
Photo Placeholder
Photo | Container
Print Selector | iOS
QuickFind | iOS
Result Label Plural
Reverse Geocoding Address | iOS
Sort List Key
Sort Selection
Title
Website
Work Address 1
Work Address 2
Work Address Short
Work City
Work Country
Work Email
Work Phone
Work Postal Code
Work State

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Returns a sorted list of all Field Names for specified Table Occurrence in the current FileMaker Pro v12 file (Table Occurrence can reference external files). Requires FileMaker Pro v12 or higher

 

Comments

Jose   Jose, San Jose
Sep 14, 2012
Great function - thanks
 
Joshua Willing Halpern   Joshua Willing Halpern, Los Angeles
Nov 21, 2016
Hey I never use them personally but does anyone have a solution that lists each repetition of repeating fields too?
 
St. Mellios   St. Mellios, Greece
Nov 11, 2017
Is it possible to add the FieldComment functionality into this function?

Thanks
 
Andrew   Andrew, Sydney, Australia
Nov 12, 2017
Joshua,

If you use this syntax:

ExecuteSQL ( "SELECT * FROM FileMaker_Fields" ; "" ; "" )

it will return additional information about the fields, not just the field name like the above custom function. For repeating fields you will get details like this:

Contacts,Address,varchar[20],66,Normal,20,2

where [20] is the number of repetitions.
 
Andrew   Andrew, Sydney, Australia
Nov 12, 2017
The FileMaker_Fields virtual table doesn't return the value for the Field Comment unfortunately - you still have to use the FieldComment function to retrieve this. You could combine these so that you could query the FileMaker_Tables and then the FileMaker_Fields for each table, and build up a list of fields to pass to the FieldComment function, e.g. something like this

FieldComment ( Get ( FileName ) ; GetFieldName ( tableName::fieldName ) )

This blog post has some more details about querying the virtual tables like the above custom function for both tables and fields:

https://www.databuzz.com.au/using-executesql-to-query-the-virtual-schemasystem-tables/
 
St. Mellios   St. Mellios, Greece
Nov 13, 2017
You 're amazing.

Thank you!!!
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Under construction. Email me your wish list for improvements.