Use connectors in the App Designer
In this topic, you learn how to use a connector in the App Designer.
Using the connectors in the App Designer offers users a range of choices for seamlessly integrating data sources into their applications.
Prerequisites
-
You have created a connector.
Procedure
-
Open your application and search for
Connector
from the resource library. -
Place the component in Resources of the application tree.
-
In Properties > connector, select your existing connector.
Ensure you rename the connector component to a logical name that reflects the data source. -
In a script, right-click.
-
Select Code Snippets.
-
Expand Connectors > NameOfConnector.
There you will find there the generated scripts for your connector, which are ready for use.
-
-
Select a method.
In this example, we will use the List method to fetch all the data and then bind the attributes to a
sap.m.ComboBox
containing a onesap.ui.core.Item
. -
Select the List method and place it in a script.
-
Remove the filter object key.
// the name of our connector component is "connectData" async function listconnectData() { const options = { fields: [{ name: "name" }, { name: "text" }, { name: "image" }, { name: "updatedAt" }, { name: "createdAt" }, { name: "updatedBy" }, { name: "createdBy" } ], order: { name: "DESC" }, }; const response = await connectData.list(options); modelComboBox.setData(response.result); // set the model to the combobox } listconnectData();
-
Bind a field to the Properties > text of the
sap.ui.core.Item
.