Product Logo

CNS Query

Query your databases without relationships.




This function Adds a new Table to the current Database File. The first parameter is the Name of the new Table, which must be unique for the current Database File. The second parameter is a return- or paragraph mark-separate list of “FieldName=FieldType” pairs used to describe the Fields that should be Added to the new Table. Valid Field Types are “Text”, “Number”, “Date”, “Time”, “Timestamp”, and “Container”. If you are using FileMaker Pro 8.5 or above, you can also specify the following Global Field Types: “GlobalText”, “GlobalNumber”, “GlobalDate”, “GlobalTime”, “GlobalTimestamp”, and “GlobalContainer”.

Note: In FileMaker Pro 8.5 and above, you must insert a “Pause” Script Step after using this function in order for the new Table to be Added.

Return TypeText
FormatCNSQuery_AddTable ( TableName ; FieldDefinitions )
Required Parameters

The Name of the Table to Add. In FileMaker Pro 11 and above, you can optionally specify the Database Filename (without the “.fp7” extension) containing the TO in the format “FileName.TableName”.


A return- or paragraph mark-separated list of “FieldName=FieldType” pairs describing the Field Names for the new Table. Use “Text”, “Number”, “Date”, “Time”, “Timestamp”, “Container”, “GlobalText”, “GlobalNumber”, “GlobalDate”, “GlobalTime”, “GlobalTimestamp”, and “GlobalContainer” as the Field Types.

Example 1

Adds a new Table to the current Database File containing two fields named "AField" and "BField" which have the Field Types Text and Number respectively.

CNSQuery_AddTable( "MyNewTable" ; "AField=Text¶BField=Number" )
Example 2

In FileMaker Pro 11 and above, use this form to add a new Table in a separate, open Database file.

CNSQuery_AddTable( "AnotherFile.MyNewTable" ; "AField=Text" )