This post is part of the SAP Build Community Challenge (April 2023) This week’s challenge involves formulas – a key feature of SAP Build Apps. Formulas are used in bindings of components, and enable you manipulate data before it is displayed in a component or before it is sent to a data source. Formulas are created in the formula editor, which provides some tools for making writing formulas easier: It has a list of functions, which can be added to the formula with a click. It has documentation on each function, plus examples. It has a live testing of functions so you can be certain how they work. It checks the syntax of the formula. It shows an expected sample result of the function. It checks the resulting data type against the data type expected by the component or flow function using the formula. Here are some learning materials about formulas: Formulas (documentation) Formula Functions (reference) No-code App Programming 101 (video by Akseli Virtanen) Setup We will give you an app that looks like this (I like cats). To set up the challenge, do the following: Download the skeleton project called Challenge - Formulas.zip.gpg. Create a new SAP Build Apps project. Import the downloaded project by selecting History > Replace in the top-right corner, and then selecting the downloaded project. Inside the app, we have already created a page variable called StartValue that contains the starting data that we want you to transform. The Challenge When you are ready, on the UI Canvas, select the Transform button, open the logic canvas, then select the Set page variable flow function, and finally go to set the formula for Assigned Value on the right (which currently returns an empty list). This is what you need to do: Write a formula that replaces the empty list for the assigned value and that does the following: Aggregates the data from StartValue so that in EndValue each name appears only once with an average calculated from the amount fields. Names should be sorted alphabetically, from A to Z Averages should be rounded to the nearest integer. Launch your app. Click the Transform button (which will display 4 names and an average for each), and then type your name in the input field. Take a screenshot and post it to THIS discussion. BONUS: Add to your entry the movie from where the 4 names in the results are taken. Your screenshot should look something like this (with your name): Good luck ... and have fun!!
... View more