SAP Builders Discussions
Join the discussion -- ask questions and discuss how you and fellow SAP Builders are using SAP Build, SAP Build Apps, SAP Build Process Automation, and SAP Build Work Zone.
Showing results for 
Search instead for 
Did you mean: 

SAP Build Challenge – Week 1 – Formulas

Developer Advocate
Developer Advocate

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 to 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:



We will give you an app that looks like this (I like cats).


To set up the challenge, do the following:

  1. Download the skeleton project called Challenge -
  2. Create a new SAP Build Apps project in your tenant or the sandbox.
  3. Import the downloaded file into your new project by selecting History > Replace in the top-right corner, and then selecting the downloaded project. 


You should now have the skeleton 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:

  1. 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.
  2. Launch your app.
  3. Click the Transform button (which will display 4 names and an average for each), and then type your name in the input field.
  4. 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 but without the blur (I need to see the names and averages) and with your name:


Good luck ... and have fun!!



You have to do 3 things in the formula (aggregate/group, sort, round), so find a function that does each one. Use the wonderful editor features that document the available functions.

For example, for aggregating, go to the List area, and then find a function that aggregates (in this case, GROUP). You'll see all the documentation for it on the right, plus a little playground inside the documentation for testing it. Pretty cool! 


See all my blogs and connect with me on Twitter / LinkedIn
176 REPLIES 176

Active Contributor

Hi @Dan_Wroblewski  ,

Very Interesting Challenge great to learn the formulae features and the movie name is Madagascar .

Build challange 1.PNG




Hi Dan,
Completed First Challenge. It was Great.
Movie Madagascar.




Thanks for the challenge Dan, 

Better Late than never !!


Here is the screenshot of the App and of course the Bonus, the names are from Madagascar movie 

Not late at all ... you have to end of month to do any and all the challenges 😺

See all my blogs and connect with me on Twitter / LinkedIn


Hi Dan ,

Thanks for the challenge. Here is the screenshot and the movie is Madagascar.

Had fun learning about formulas!




Hi Dan,

Thank you for the challenge. A bit tricky and interesting though 🙂
Here's my screenshot for the challenge and movie is Madagascar.



0 Kudos

Great! 😺

We didn't want it to be too easy

See all my blogs and connect with me on Twitter / LinkedIn


Hello Daniel,

Great idea to create these challenges.
It really forced me to study the docs and research how to use the functions used.
If it's not too much to ask, feel free to create new formula challenges (besides, of course, the others to come)
Thank you.
Best regards from Brazil.



0 Kudos

Weekly challenges, including or especially for formulas, is an interesting and fun idea. Thanks for participating.

See all my blogs and connect with me on Twitter / LinkedIn

Active Contributor

Sorry for late @Dan_Wroblewski 

This is the output




0 Kudos

Not late at all -- you have till May 7 for all of them 😺

See all my blogs and connect with me on Twitter / LinkedIn


My first time trying anything with Build Apps 😞 I couldn't get the numbers! , hence the sad smiley in the image. Anyway i can get some help on this? 
Also the Movie is Madagascar ! Have to rewatch now 
Screenshot 2023-04-12 162819.png

0 Kudos

I didn't mean to make you sad 😐 Share your formula and we can work together. You obviously got the grouping part OK.

See all my blogs and connect with me on Twitter / LinkedIn

I had used this formula for the grouping - 

GROUP(pageVars.StartValue,, {name:key,actors:items})

and sorting then 


0 Kudos

Great ... you've grouped the data but you haven't created a single average. So instead of "actors : items" (which just creates the same list of amounts, you want a field called "average" that is equal to a number that is the average of all those items. 

Luckily, you have all the items to average -- in the items object -- but you have to use the functions available to take all that data and turn it into a single number. Obviously, AVERAGE will be involved somehow, and in order to use AVERAGE you need a list of values. Consider using PLUCK to get that list from items.

See all my blogs and connect with me on Twitter / LinkedIn


I tried to concat the average from the item . Not sure where I am going wrong 😞 
SORT_BY_KEY((GROUP(pageVars.StartValue, +" "+ AVERAGE(PLUCK(item,"amount")),{name:key,average:items})),"name","asc")

0 Kudos

SORT_BY_KEY((GROUP(pageVars.StartValue, +" "+ AVERAGE(PLUCK(item,"amount")),{name:key,average:items})),"name","asc")


You have to Group the items, so you need something like this:

GROUP(pageVars.StartValue,, {Some object}) 

This creates a list with one object per group (shown as pseudocode above as "Some object", but what do you want that object to be?

You want that object to have the name of the group and then an average, something like this:

{ "name" : "Marty", "average" : 12.2}

The first part you pretty much have, so it is like this:

{name: key, average: 10.11}

But of course you can't hardcode the value, you have to calculate it from the "items" list you get as an object as part of the GROUP function. In order to use the AVERAGE function, you need a simple list of numbers, so you need to convert the "items" object into the simple list, and this you use the PLUCK function.

So in the end you get:

GROUP(pageVars.StartValue,, {name: key, average: ROUND(AVERAGE(PLUCK(items,"amount")), 0) })

I added a ROUND function – part of requirement – which takes an extra parameter 0 to indicate to round it to nearest whole number.

The only thing left is to sort it, which you have already started with above with the SORT_BY_KEY function.

See all my blogs and connect with me on Twitter / LinkedIn

Thank you for virtually solving this for me and helping me understand where I was going wrong. I did try to add this part - AVERAGE(PLUCK(item,"amount")) with a value to "average" but did not consider items as the object to be used ! Thank you 




Active Participant

Great challenge as always.

The movie is Madagascar. 




Hi @Dan_Wroblewski ,

Thanks for the interesting challenge. The Movie name is Madagascar!

Screenshot 2023-04-13 125703.png


Thanks for the challenge. It is great way to learn and get familiar with the tools. Looking forward for upcoming challenges.



Hi @Dan_Wroblewski ,

Thanks for the challenge, i managed to erase StartValue data at first and spent some long minutes wondering what kind of magic was bringing data in the app... and then i reimported everything.

The Movie name is Madagascar!




Product and Topic Expert
Product and Topic Expert

Hello Dan,

SAP Build Challenge 1.png

Movie is Madagascar.

Inspiring SAP Build Challenge.


0 Kudos

Thanks for participating 😺

See all my blogs and connect with me on Twitter / LinkedIn


Hi Dan,

Thanks for this challenge

Challenge 01 Vladimir Romero.jpeg


0 Kudos

Can you show your formula?

See all my blogs and connect with me on Twitter / LinkedIn


Hi Dan, 

Thanks for the challenge . late to the trend..;)

Movie name: Madagascar



Product and Topic Expert
Product and Topic Expert

Screenshot 2023-04-13 at 4.39.06 PM.png

Hi Daniel, please see above.  And the movie is Madagascar.

Product and Topic Expert
Product and Topic Expert

SAP Build Challenge 1.jpg

Finally 😉

0 Kudos

Thanks for entering and keeping at it until it was complete 😺

See all my blogs and connect with me on Twitter / LinkedIn

Developer Advocate
Developer Advocate

You ruined my Friday...

Screenshot 2023-04-14 at 22.48.54.png

Personally, I prefer Skipper, Kowalski (a friend of Wroblewski?), Rico and Private 🐧 

Sorry about that. Yes, I should have used the penguins, or the monkeys

See all my blogs and connect with me on Twitter / LinkedIn

Active Contributor

I am joining a little late to the party.. Nevertheless, here is my entry for this challenge.

Movie: Madagascar - I like to move it, move it!! 

Screenshot 2023-04-17 at 17.17.16.png

 Looking forward to crack the others too..




Not late at all ... still another 3 weeks for all the challenges ... hope you continue with the others 😺

See all my blogs and connect with me on Twitter / LinkedIn


Hello Dan

I get the below error when I try to import the project on my AppGyver platform. Is the project only compatible with SAP build?


Thanks for your time




I believe you can export from SAP Build and import to AppGyver community edition.

But you can quickly sign up for the sandbox system to do the challenges: ... let me know if that works for you

See all my blogs and connect with me on Twitter / LinkedIn

0 Kudos

Hello Dan,

Sorry for being late,  but I discovered this challenge just yesterday

Thanks for this challenge!!

Please see the screenshot below:


0 Kudos

Thanks for joining ... but the data above is not correct ... what happened? You were supposed to use the data already inside the app 

See all my blogs and connect with me on Twitter / LinkedIn

Sorry, I was thinking about switching the data to something I liked best.