microappdata
description
Returns data from a Microapp. A filter can be applied to query the Microapp. In addition a limit can be used to improve performance. A default microapp data limit is in the server settings. A maximum value must be chosen to get all the rows.
parameters
The X-Auth-Token and X-User-Id are derived from the values authToken and userId returned from the login endpoint and are used in the HTTP header.
Resource
{
"microAppID":"<insert microapp id here>"
}response
A JSON document with the Microapp data.
example
Only the microAppID needs to be specified, in the simplest case for fetching all the data in a Microapp. It’s value can be found on the properties page of the Microapp in the editor.
Example of fetching all data from a Microapp:
POST /api/microappdata
X-Auth-Token: <token goes here>
X-User-Id: <userID goes here>
{
"microAppID":"<insert microapp id here>"
}
filter example
A filter can be applied to narrow the results of the fetch using the optSearchFilters array. In the optSearchFilters the resourceID is the same as the microappid. The fieldID is an identifier that corresponds to the Field Name. It can be found in the field properties in the editor.
Example of fetching data from a microapp with a filter:
sort example
The data fetched from the Microapp can be sorted. The order and field parameters are used in the searchFilter to specify which Microapp sort field and if it is ascending or descending. The sort fields are configured in the Microapp Results Tab. Sort field 1 corresponds to the field value 1 and so on. Where order is either 1 = ascending or -1 = descending.
Example fetching microapp rows using Sort Field 1.
paging example
Pagination is achieved using the skip and limit parameters. The skip parameter specifies the number of results to skip at the beginning. The limit parameter specifies the maximum number of results to return.
Example fetching microapp rows using pagination.
The buzzyFormat parameter is used to output raw data instead of JSON. This is used only in exceptional situations and please contact your buzzy representative for more information.
finding embedded row data example
When have Sub-Tables (1:M) you have a parent -> child relationship. So each parent row (the embeddingRow) can have many children.
For example, you have a row for each Invoice and you need to search the Seb-table for the Invoice Lines.
Example fetching microapp rows using `embeddingRowID`. As part of the example, assume "sortVal2" has row data to do with "approved". So to show all the Invoice Lines for the specific Invoice that are approved, the query will look like:
using mongoDB query syntax example
Buzzy is based on Mongo DB and allows you to use MongDB's query syntax, allow for more complex queries. Each object in the optViewFilters array is AND'd. Note for OR you can include that in each object.
Example fetching microapp rows using a MongoDB like query where sortVal5 is between lowVal and highVal
geo/spatial query examples
Buzzy supports MongoDB's geospatial queries through the sortValGeometry field. This allows you to search for data based on geographic locations and boundaries.
Example 1: Searching within a radius
This example searches for data within a circular area around a specific point (Manly, NSW in this case):
Example 2: Searching within a polygon
This example searches for data within a polygon boundary (roughly the outline of Australia):
Example 3: Finding data within a map's bounding box
A common use case is to find data that matches the current bounding box of a map as a user pans around. This example shows how to query for data within the current map viewport:
For a complete implementation example of a map with location data, see the Event Locations Map example.
For more info on MongoDB queries see here and for some additional Buzzy examples with custom code widgets, including geospatial queries, see here
You can also use these geo/spatial query parameters with the Node.js API Client and the React API in Code Widgets.
See Also
Common API Examples - See data fetching in all three API formats
Last updated