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.
cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Build Challenge – Week 1 – Formulas

Dan_Wroblewski
Developer Advocate
Developer Advocate
35,544

This post is part of the SAP Build Community Challenge (April 2023)

dan_wroblewski_0-1680162815071.png

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.

dan_wroblewski_0-1680162183899.png

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:

 

Setup

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

dan_wroblewski_0-1680161844555.png

To set up the challenge, do the following:

  1. Download the skeleton project called Challenge - Formulas.zip.gpg.
  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. 

dan_wroblewski_1-1680205193965.png

You should now have the skeleton project.

dan_wroblewski_0-1680205123196.png

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).

dan_wroblewski_3-1680160487847.png

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:

dan_wroblewski_1-1680162021890.png

Good luck ... and have fun!!

 

Hint

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! 

 dan_wroblewski_0-1680588176659.png




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

RichDBlumberg
Participant
17,823

Thanks! Look forward to giving this interesting challenge a try! 

14,506

Where can I learn! Are there any trainings? 

14,437

Did you try out the challenge first?

After that:

https://learning.sap.com/learning-journey/compose-and-automate-with-sap-build-the-no-code-way

https://learning.sap.com/learning-journey/utilize-sap-build-for-low-code-no-code-applications-and-au...

And internally at SAP there are additional resources, if you contact me offline




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

abdullahgunes
Participant
17,813

Hi all,

First answer from me 🙂

Movie: Madagascar

image.png

17,803

Thanks 😊 But can you add screenshot without the blur




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

PatrikMajer
Explorer
17,824

Hi Dan, 

thank you for a great challenge. 

PatrikMajer_0-1680270883609.png

 

17,483

Movie is Madagascar - of course

17,476

😺

But did you build the formula and solve the non-bonus challenge?




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

17,469

Yes - we worked together with Patrik (he is my Padawan) on the solution above 🙂

Btw great Idea these dev challenges - really funny way how to learn - not just - problem solving, algorithmic thinking and as a bonus - deep dive to the tool (Appgyver) itself and documentation as well.

17,455

The force is strong in you. Thanks for kind words and for participating.




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

17,420

One requirement was to round up to no decimal points ... can you do that?




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

17,391

He does that on friday, but posted picture only on teams (and without name). Now he has day off - so just like that:

vbalko_0-1680517401723.png

And screenshot of our team as a proof 🙂

vbalko_1-1680517438397.png

 

17,366

Hi Dan, 

I have overlooked this requirement on Friday. Formula updated on Friday evening as mentioned by my colleague Vlado 🙂

Have a great day.

PatrikMajer_0-1680520693803.png

 

 

induthiru
Participant
17,805

Hello Dan,

Thanks for this challenge, tricky and interesting 🙂. Please see the screenshot below:

induthiru_0-1680274706095.png

Regards,
Indu

encarrero
Participant
17,784

038B4D7D-1209-4CBA-9029-44734C32E5B4.jpeg

Farid
Active Participant
17,777

ChatRenfrogne.jpg

 

aoyang
Contributor
17,736

Completed the challenge but don't know what movie they are from 🙃

SAP Build Challenge.jpg

Ajit_K_Panda
Product and Topic Expert
Product and Topic Expert
17,571

Hi, 

ajitkumarpanda_1-1680437552920.png

Looking forwards to the next challenge!!

Krishnakumar
Product and Topic Expert
Product and Topic Expert
17,463

Hi, Here is my screenshot.  

Krishnakumar_2-1680514460344.png

 

 

17,442

Nice ... but you're supposed to enter your name in the input box 😉




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

Krishnakumar
Product and Topic Expert
Product and Topic Expert
17,426

Movie is Madagascar

Krishnakumar_0-1680515743943.png

Added my name now

manuelbordallo
Explorer
17,393

Hello,

Done!

Film: Madagascar 😉

SAP_Build_Apps-3.jpg

Best regards,

Manuel

17,375

That's one grumpy cat!! What happened to your name?




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

17,321

I didn't read all the "requirements"... 😅

SAP_Build_Apps-4.jpg

17,311

RTFM 🙂




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

PAstolfi86
Explorer
17,240

Hi, below my screenshot.

PAstolfi86_0-1680536117426.jpeg

Regards.

Piervincenzo Astolfi

anjalymgeorge
Discoverer
17,183

Hi Dan,

Thanks for the challenge.

anjalymgeorge_0-1680552331120.png

 

MioYasutake
Active Contributor
17,186

My week 1 submission. The formula was a bit challenging for the first week.

miyasuta_0-1680554991927.png

 

17,069

Glad you stuck with it and succeeded 🕺




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

SandipAgarwalla
Active Contributor
17,042

Finally managed the formula using the hints you have given. Thanks for this interesting learning challenge. 

Week1 - Challenge.jpg

0 Kudos
17,037

Glad it worked out (and you made my grumpy cat happy) ... do you know the movie the data aggregation results hint at? 




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

17,025

mad.jpg

one of my favorite movies. 

0 Kudos
17,006

Yes, but which is your favorite - 1, 2 or 3?




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

0 Kudos
16,974

I would say the 2nd one. Which one is your favorite

16,889

I agree

Zuba: Alakay, turn around!

Alex: No, Pop, it's hop, shuffle, ball change, hip swish, THEN turn around.




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

Ian_Thain
Developer Advocate
Developer Advocate

0 Kudos
16,910

Nice ... but what about the movie?




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

enzoleon
Participant
16,944

Hi Dan, nice challenge!

The movie is Madagascar 🤣

enzoleon_0-1680612414968.png

 

Bharathi_S
Explorer
16,934

Hello Dan!,

Thank you for this challenge!

Movie Name: Madagascar

SmartSelect_20230407_145741_Chrome.jpg