loadData
Description
Loads the data from a local table, staging database or 3rd party connector.
Input / Parameter
dataset
The name of the local table to load data from.
Text
-
-
Yes
fields
Specifies which fields to retrieve from the local table.
List
-
-
No
join
Details about any tables to be joined with the primary dataset for data retrieval.
Array/List
-
-
No
filter
The filters for the fields and values to retrieve.
List
-
-
Yes
sort
Specifies the field and direction for sorting the returned data.
List
-
-
No
limit
The number of records to be returned from the local table.
Number
-
-
No
page
The page number for pagination purposes.
Number
-
-
No
extra
Extra parameters stored and passed to callback.
Any
-
-
No
Output
Returns the formatted information.
Object
Object
success
Boolean value to denote whether the function was executed successfully.
Text
message
The message to print.
Text
data
Any additional message or data to print.
Text
Callback
callback
The function to be executed if the records are loaded successfully.
errorCallback
The function to be executed if the records are not loaded successfully.
Example
In this example, we will load the data from the Local Table and display it in a flatlist component.
Steps
Make sure a
Local Table
component is created and filled on the services panel in the service page.Drag a button component to a page in the mobile designer.
Drag a
flatlist
component to a page in the mobile designer, and drag alabel
component into theflatlist
component.Fill the
flatlist
component property in the page and fill thelabel
component property in theflatlist
component, make sure thelabel
componentfield
value matches the key of the data that is being stored in the local table.Select the event
press
and drag theDataset.loadData
function to the event flow. Fill in the parameters of the function.
Result
The data should be loaded from the local table and displayed in the flalist component.
Last updated