# loadData

## Description

Loads the data from a local table, staging database or 3rd party connector.

## Input / Parameter

| Name     | Description                                                | Input Type  | Default | Options | Required |
| -------- | ---------------------------------------------------------- | ----------- | ------- | ------- | -------- |
| dataset  | The name of the local table to load data from.             | String/Text | -       | -       | Yes      |
| limit    | The number of records to be returned from the local table. | Number      | -       | -       | No       |
| page     | The page number.                                           | Number      | -       | -       | No       |
| filter   | The filters for the fields and values to retrieve.         | Array/List  | -       | -       | Yes      |
| orFilter | Additional filters for the fields and values to retrieve.  | Array/List  | -       | -       | No       |
| order    | Sorts the data with the provided details.                  | Array/List  | -       | -       | No       |
| extra    | Extra parameters stored and passed to callback.            | Any         | -       | -       | No       |

## Output

| Description                                 | Output Type |
| ------------------------------------------- | ----------- |
| Returns the list of records that is loaded. | Array/List  |

## 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.

## Video

Coming Soon.

## Example

The user wants to load the data from dataset "l\_customer".

### Step

1. Create a button, pannel, datalist and label from component.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-77d82e254b7fb5a13513e3627da2a8a0016beb54%2FloadData-step-1.png?alt=media)

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-cdddccae40b2dbeaa222e2bc95b6a52b355078be%2FloadData-step-2.png?alt=media)

   \
   ( Set the dataset name "l\_customer" for column Dataset. We assumed the dataset name have been created when you create local table in Services. )

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-10438670cafd1af80b9f840d225b9ba3eea9ebb5%2FloadData-step-3.png?alt=media)

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-fc0910e93c27a7dc2dd7ca2158dc76fc91406ba9%2FloadData-step-4.png?alt=media)

   \
   ( When you click the each label, set the field name to "code" "id" and "name" respectively for field column. )<br>
2. Call the function "dataFromString" and define the dataset and string.\
   dataset: l\_customer\
   string: \[{"id":"1","code":"C20000","name":"Maxi-Teq","address":"300 Billings Drive","tel":"555-0110","term":"C.O.D"},{"id":"2","code":"C23900","name":"Parameter Technology","address":"908 Darby Road","tel":"555-0119","term":"C.O.D"}

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-03afdda424484db7d9574dae3b874da678b1171f%2FloadData-step-5.png?alt=media)
3. Call the function "loadData"and define the dataset and limit.\
   dataset: l\_customer\
   limit: 20

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-5e9cb109a10d58d84fa2cc125a91ae18539358da%2FloadData-step-6.png?alt=media)

### Result

![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-9321e3c138959019ef0c44621d3ce3dda3e2f80b%2FloadData-result-1.png?alt=media)

![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-3a42fe21942c3ee05591dc5bff41447e088b8d73%2FloadData-result-2.png?alt=media) ( When you call the function "dataFromString", and put a string in json format.The outcome was shown in image above. )

![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-7bd76cda17355831a2cc325b135a1e1ade416acd%2FloadData-result-3.png?alt=media)\
( When you call the function "loadData", and set the limit is 20, therefore it will display the data from id 1-20 instead of until id 24. )

## Links
