Now that you have your backend, you can finish the product list page by adding data resources and binding the properties of your list item composite component.
After creating a composite component and setting up your backend, you will now create the front end UI that will consume both business data and your custom data.
Step 1Add name of page to navigation
โ
SAP Build Apps lets you create a navigation menu so you can go directly to different pages in your app.
Go back to your Social Media app.
Open the Navigation tab.
Click on the List of Products page link.
Change the Tab name to List of Products.
Fix navigation
Click Save.
Step 2Enable SAP BTP authentication
+
You need to enable SAP BTP authentication since you want to use entities and functions from Visual Cloud Functions in your app.
SAP BTP authentication may be enabled already, if after clicking the Auth tab, you see this screen. If so, you can skip this step.
SAP BTP authentication complete
Go to the Auth tab.
Click Enable Authentication.
Auth
Select SAP BTP Authentication.
On the confirmation popup, click OK.
Step 3Create data resource for Northwind
+
As the business data, we will use the Northwind OData service, but we could have easily used a destination to an S/4HANA system.
In this step, if you want to use a destination that you have already set up to Northwind, you can follow the instructions in the second tab.
Open the Data tab.
Under SAP Build Apps classic data entities, click Create Data Entity, and select OData integration.
Northwind
Set the Base API URL to https://services.odata.org/v4/northwind/northwind.svc/
Click Verify URL.
On the left, enable the Products entity.
Click Save Data Resources.
Northwind configuration
Click Save (upper right).
These instructions are for when you have a destination to the Northwind OData service. It is to illustrate how to connect to a data source via a destination, like for S/4HANA.
For more information on creating destinations that can be consumed by SAP Build Apps, see BTP Destinations Integration.
Open the Data tab.
Click Add Integration.
Add integration
Then click BTP Destinations.
BTP destinations
Pick the Northwind destination on the left.
Select Northwind
Click Install Installation.
Select the Products entity, and then click Enable Data Entity.
Install integration
Click Save, the Exit.
Step 4Create data resources for backend
+
Still on the Data tab, click Add Integration.
Click Cloud Functions.
Visual Cloud Functions
Select Social Media Backend
Social Media Backend
Click Install Integration.
Select the Rating entity, and click Enable Data Entity.
Select the Comment entity, and click Enable Data Entity.
Entities enabled
Click Cloud functions.
Functions tab
Select AverageRating, and then click Enable Cloud Function.
Click Save, then Exit.
Step 5Create variables
+
Go back to the UI canvas, and select Variables.
UI variables
Under App Variables, click Add App Variable.
App variables
Select the new variable (i.e., variable1), and rename it to Ratings.
Set the type to List, and the list item type to Object.
Ratings app variable
On the one hand, a type of object with no fields has no schema, so it is more difficult to work with in the formula editor. But on the other hand, it is compatible with any object and saves us the time of defining all the fields.
Under Data Variables, click Add Data Variable.
Select Products.
Remove delay
Click Save (upper right).
Step 6Bind composite component
+
Now that we have all the data in variables, we want to bind them to the list component.
Go back to View.
Select the Large Image List Item, and in the Properties tab, set the following:
For fun, I wanted each product to have a picture. The simplest was to take a service that returns a picture. Here’s some formulas to return random pictures (no guarantee these will be working โ feel free to use your own images):
The formula for the image may appear in red as an error, but it will work. Just save it.
The formulas for rating and rating count may have field names marked in red. Remember, we did not create a schema for our app variable, so the formula editor does know that these will exist.
Still with the Large Image List Item selected, and in the Style tab, set the following:
Edit the default style.
Under Effects, enable the shadow, set shadow size to Medium, and set the shadow color to static color #AF9E8D.
Click Save, then Exit.
Step 7Get the rating data
+
Click an open area on the canvas, and open the logic pane.
Page logic panel
For the Page mounted event, add an Run cloud function flow function, and then a Set app variable flow function, and connect them like this.
Rating logic
Configure the “Run cloud function” to call the AverageRating function (this is probably already set since you only have one function).
Configure function
Configure the “Set app variable”.
Field
Value
Variable name
Ratings
Assigned value
Formula
ย
outputs["Run cloud function"].values.ratings
Again, the formula editor might show the formula in red because we did not set the schema for the app variable.
Click Save (upper right).
Step 8Run the app
+
Click the Launch tab, and then Open Preview Portal.
Launch
Click Open web preview (left).
Select your project, Social Media.
Run app
The above is shown with the browser’s developer tools, with the iPhone device set.
All of the products are shown, and all the ratings are 0 since we did not create a page to allow the user to add them. You’ll do that in the next tutorial.
Share feedback on this tutorial or join the conversation in SAP Community.
Submit detailed feedbackDiscuss in Community
Steps
Step 1 of 8
1. Add name of page to navigation2. Enable SAP BTP authentication3. Create data resource for Northwind4. Create data resources for backend5. Create variables6. Bind composite component7. Get the rating data8. Run the app
Joule
AI Notice
Joule is an AI assistant. Generative AI may produce inaccurate, incomplete, or biased information. Always verify important details before acting on them.
Conversations are sent to SAP-hosted large language models for processing. Do not include personal data, credentials, or confidential information in your messages.
Joule's responses are based on the SAP tutorial catalog and may not reflect the latest product changes. For authoritative guidance, consult the linked tutorials and official SAP documentation.