Data Sources
Overview
Data Sources are named and reusable manifest entities that hold configuration settings for services. This concept comes from the App Descriptor (see "sap.app" namespace). In the card context, named Data Sources can be used with a special double bracket syntax to construct data request urls - "{{dataSources.dataSourceName.uri}}".
Data Sources' properties:
Property | Type | Required | Description | Schema Version | Since |
---|---|---|---|---|---|
uri | string | Yes | URL to the data source. | 1.74 | |
type | string | no | Either OData or JSON . |
1.74 |
Note: Types ODataAnnotation
, INA
, and XML
, as well as
properties
localUri
, annotations
and maxAge
are no supported.
Examples
Using the configured dataSources
in "sap.app" to make request for top products:
{ "sap.app": { "id": "card.explorer.dataSources.topProducts", "type": "card", "dataSources": { "products": { "uri": "/SEPMRA_PROD_MAN", "type": "OData" } }, "applicationVersion": { "version": "1.0.0" } }, "sap.card": { "data": { "request": { "url": "{{dataSources.products.uri}}/SEPMRA_C_PD_Product", "parameters": { "$inlinecount": "allpages" } } }, "type": "List", "header": { ... }, "content": { "data": { "path": "/d/results" }, "item": { "title": "{Name}", "description": "{ProductCategory}" } ... } } }Try it Out