Describing Data Resources


After completing this lesson, you will be able to:

  • Describe the purpose of a data resource..
  • Discuss the types of data resources.

Data Resources

Types of Data Storage

Applications live and die on their data, and without some form of data, an app wouldn’t be able to do much.

Some data is merely temporary and is stored while the app is running, such as:

  • Data entered by the user.
  • Data related to the state of the app; for example, while a user is playing a game, the app would need to store their score, name, and the current state of the board (for board games) or location (for adventure games).

Some data is stored in data stores or databases for use with other users, for example:

  • Business data, such as invoices and sales orders.
  • Sports data, such as teams and players and their statistics.
  • Geological data, such as earthquakes, their magnitude, and locations.

There are many examples. The data must be stored in a central location, and you must know how to connect to it.

A data resource in an SAP Build Apps application defines all the details needed to connect with the data. Generally, this is a REST or OData service and requires a URL and some parameters to specify what data to return.

Types of Data Resources

There are different types of back-end systems from which you can retrieve data.

SAP Build Apps lets you connect to the following:

  • OData Integration
  • REST API Direct Integration
  • On-Device Storage
  • Marketplace Data Resources
OData Integration

This type of data resource lets you connect to OData services. OData services are services you reach with a URL and are designed for supplying business data. OData services conform to a rigid set of rules for defining the format of the URLs and of the returned data.

This type of data resource is important because SAP exposes much of its business data with OData services.

REST API Direct Integration

This type of data resource lets you connect to REST services. REST services do not need to conform to the same rigid rules for URLs and responses, as OData services do. This can make REST services require a little more work to understand, and to configure within SAP Build Apps.

But there are many, many REST services – for getting the weather, sports statistics, playing games, even some SAP business services – so you are likely to eventually need to make a REST data resource.

On-Device Storage

This data resource actually creates a data store on the device the user is using, as opposed to REST and OData data resources, which connect to existing data stores. Such data is only stored on the current user’s device, so it is used for data needed only by the current user and that does not have to be shared.

This type of data resource could be used for user preferences or for saving the current state of the app for the current user.

Marketplace Data Resources

Marketplace data resources can be of any type. They are data resources that are defined and stored in the Marketplace and can be quickly installed from there. You may want to use the few data resources prebuilt for you, or you may want to create a data resource and be able to quickly reuse it in multiple projects.

We will discuss the above data resource types in more detail in the rest of this unit.

There are some additional and important data resource types – especially for use in connecting to SAP back-ends – that depend on users being authenticated via SAP BTP, and these will be discussed in a later unit.

Visual Cloud Functions Integration

Visual Cloud Functions lets you easily create your own data store, not just connect to an existing one, and let multiple apps access it and let you share the data among many users.

You create Visual Cloud Functions by creating an SAP Build Apps back-end project (from the lobby). Within the back-end project you create data entities (to store data) and functions (to do calculations and manipulations on that data). Once you have deployed a back-end project, you can create a data resource to connect to the data entities to retrieve their data or use flow functions to execute the server functions.

OData Integration with BTP Destination

OData with a BTP destination is the same as without except that the URL and authentication is defined by an SAP BTP destination.

REST Integration with BTP Destinations

REST with a BTP destination is the same as without except that the URL and authentication is defined by an SAP BTP destination.

Log in to track your progress & complete quizzes