Link Search Menu Expand Document

Search/Display multiple Records using Datasource

Tip: You can use Manage Records to list the database’s Records without running the application.

To display a list of Records from the database in your application, you will need to add a Search/Display multiple Records Datasource. This Datasource is required in order to specify when to load the records and how to display them.

  1. Navigate to the Screen that you want to add the Datasource.
  2. Press the Datasource button, and then the + Create datasource button.
  3. Select the Kodika Server tab.
  4. Select the Data Type that you want to fetch records from.
  5. Select Search/Display Multiple Data Type Name.
  6. Select the Records to fetch.
  7. Fill in the Advanced Search parameter, if needed.
  8. Change the Sorting, if needed.
  9. Set a Limit to the results that will be displayed, if needed.
  10. Connect at least the parameters of the On Success response.
  11. Press Save.
  12. Close Datasource popup.
  13. Create a Start a Datasource Request Event Action and connect it to an Event, if needed.

Select the Records to fetch

There are two ways to display a List of Records.

  1. Get all Records from the database and use Advanced Search, if needed, to filter them.
  2. Get the Records referenced from a Relationship and define the parent Record.

Examples for Get All

  • Show all the Posts. You can use Advanced Search to filter only the ones posted in the last 30 days.
  • Show all the Categories of the application.

Examples for Relationship Reference

  • Show the Posts of a specific Category. You have a Category Data Type with an One to Many Relationship to the Post Data Type. You select to display the Category -> Posts and bind the Category to the Category with the Posts.
  • Show the Friends of the Author of a Post. You have a Post Data Type with an One to One Relationship to the User Data Type that is the author of the Post. User Data Type has a Many to Many Relationship to the User Data Type that is the Friends of the User. So, by selecting the Post -> Author -> Friends option and then binding the Post, you can have the Friends of the Author of the Post.

Request Parameters

Filter

Change the records that will be fetched.

Combine AND and OR conditions on the Records that have been already filtered.

Sorting

Select the Data Type property and the order (Ascending/Descending) that the Records will use to get sorted.

Limit

Type the number of Records you want the datasource to display. The Limit will be applied after the Advanced Search and Sorting. Note: Leave the value empty to display all the fetched records.

Responses

Note: If any of the validations failed, the On Success response is not called, and only the respective failure response is called.

On Success

Called when the records are fetched successfully.

Parameters:

  • records: The List of the records that were requested.

When Wrong Filter Value

Called when the the root record to fetch from does not exist.

Parameters:

  • Error: A text with an error message.

When Offline

Called when the user has no Internet connection.

Parameters:

  • Error: A text with an error message.