fullTableSQLasJSON ( tablename ; condition )
Performs SQL query on designated table and returns response wrapped as JSON.
Be the first to rate this function Log in to vote
Jonni™ - Show more from this author |
or
FullTableSQLasJSON ( "myTable" ; "" )
"data" :
{
"columns" : 6,
"rows" : 2
},
"response" :
[
{
"fieldName1" : "value1",
"fieldName2" : "value2",
"fieldName3" : "value3",
"fieldName4" : "value4",
"fieldName5" : "value5",
"fieldName6" : "value6"
},
{
"fieldName1" : "value1",
"fieldName2" : "value2",
"fieldName3" : "value3",
"fieldName4" : "value4",
"fieldName5" : "value5",
"fieldName6" : "value6"
}
]
}
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
This function performs an ExecuteSQL query to the designated table to retrieve all field names in the table. This is then followed by a second query retrieving the value of those fields for the entire table if the condition is passed blank or partial table if SQL conditions are passed in the conditions parameter.
The results of both queries are then wrapped into a JSON array where each row is defined as one object consisting of entities where key is defined as the returned field name populated but the returned value.
Additionally row count and field count are returned within the data object.
Requires FileMaker 18 or higher.
Comments
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.