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
30,188

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

0 Kudos
3,735

Nice data, I just can't check if the function is correct and does what it is supposed to do 😺 




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

3,721

You’re right, as soon as I can, I’ll publish the one with the correct data.

Sorry!!

hismail
Discoverer
3,876

Hi Dan,

Thanks for the interesting challenge.

Movie: Madagascar

 

Challenge 1 - Hesham Ismail.jpg

 

dinah
Product and Topic Expert
Product and Topic Expert
3,898

My Output:

dinah_0-1681996290880.png

 

0 Kudos
3,842

Nice work 😺 Feel free to do the other challenges

https://blogs.sap.com/2023/03/30/you-think-you-know-sap-build-take-our-challenge/




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

Pamela
Product and Topic Expert
Product and Topic Expert
3,897

Hello Dan,

Thanks for the interesting challenge. 

Just discovered this challenge yesterday, hoping it's not too late to joing it.

Here is my screenshot:

Pamela_0-1682045257418.png

thanks,

Pamela

0 Kudos
3,847

Of course not too late 😺Please participate in all the challenges

https://blogs.sap.com/2023/03/30/you-think-you-know-sap-build-take-our-challenge/




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

SaiNithesh_Gajula
Active Participant
3,899

Hello Dan,

Movie name : Madagascar

Challenge is very interesting. I was trying this quite long time. After going through the steps and suggestions from the comments multiple times, I have achieved finally. 😎

sainithesh_0-1682172248214.png

 

0 Kudos
3,863

Sorry it took a long time ... what was particularly difficult?

Try the other challenges 😺

https://blogs.sap.com/2023/03/30/you-think-you-know-sap-build-take-our-challenge/




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

3,837

Actually, It took more time for me to identify that I have to use PLUCK to get amount values from the items loop.

Anyhow its a good learning 😀

rajkumar
Explorer
3,962

 

rajkumar_0-1682187625427.png

 

0 Kudos
3,874

Nice work...I hope you will try the other challenges

https://blogs.sap.com/2023/03/30/you-think-you-know-sap-build-take-our-challenge/




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

HelenaFortun
Explorer
3,959

Hello Dan,

I started a bit late with the challenge.... I like such tasks!!! 

Here my first part:

Screenshot_20230422_233739_SAP Build Apps.jpg

The movie is Madagascar!

Best regards!

Helena

0 Kudos
3,889

Thanks for participating and glad you liked it. You left out the sorting part.

After adding the sorting, try out the other challenges ... never too late 😺

https://blogs.sap.com/2023/03/30/you-think-you-know-sap-build-take-our-challenge/




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

vinay050
Participant
3,958

Hello @Dan_Wroblewski ,

Really enjoyed working on this challenge. 

Move name is Madagascar and following is the screenshot of my app 

vinay050_0-1682213676572.png

Regards

Vinay

rsraj
Explorer
3,979

Hello Dan,

Here's my first week challenge. Thank you very much!

Challenge1.PNG

0 Kudos
3,897

Thanks for joining the challenge 😺 Please consider continuing onto the rest

https://blogs.sap.com/2023/03/30/you-think-you-know-sap-build-take-our-challenge/




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

shridharshetty
Explorer
3,983

Thanks for the Build Challenge.

Movie name: Madagascar.

Week 1.png

0 Kudos
3,939

Great job ... thanks for participating 😺




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

mrpz
Explorer
3,964

Hello,

Starting at full speed the challenge this week! 🙂 

The Key is to work with the appgyver doc webpage.

mrpz_0-1682363729421.png

 

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos
3,947

Nothing better than good documentation 😺




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

jakku
Explorer
3,952

Great Challenge, Below is my screenshot.

 

Screenshot 2023-04-25 155310.png

0 Kudos
3,948

Thanks for participating ... please enjoy the others 😺




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

Alejandro1
Product and Topic Expert
Product and Topic Expert
3,895

Hello @Dan_Wroblewski,

SAP Build Challenge – Week 1 – Formulas:
Alejandro1_0-1682493244665.png

Looking forward for more exercises like this one to get familiar with the Formulas of SAP Build Apps!!

Thank you 🙂

 

0 Kudos
3,842

Perhaps we could continue with a regular (weekly, monthly) challenge related to formulas ... we'll see 😺 




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

CarlGP
Newcomer
3,890

Hi Dan,

I just found out about these Challenges today, and it took a while to get the hang of the formulas. But I now finally got the result below  😀. Thanks!

CarlGP_0-1682506360561.png

 

0 Kudos
3,851

I'm glad you finally found them 😺 Please participate in the others also




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

staseeb
Active Participant
3,878

Hello @Dan_Wroblewski ,

Thank you for this challenge! 

Movie Name: Madagascar

SAP Build Challenge 1.png

 

GRABLERE
Product and Topic Expert
Product and Topic Expert
3,870

Great Challenge!:)

GRABLERE_0-1682542442176.png

 

0 Kudos
3,859

Thanks for participating 😺




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

WannL_Tan
Explorer
3,868

Great exercise!

WannL_Tan_0-1682568857470.png

 

0 Kudos
3,865

Thanks for joining 😺 The numbers are slightly off. I assume you rounded down instead of up.




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

3,852

Thanks Dan.  I used function DIV rather than divide with function CEIL.

VinayKumawat
Product and Topic Expert
Product and Topic Expert
3,805

I am little late, but it is never too late to learn.

Thanks for the challenge.

Movie is Madagascarchallenge1.png

 

0 Kudos
3,790

Never too late, and still more than a week left to do at least 1 more 😺




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

TimothySanty
Participant
3,803

Hello everyone! I'm a bit late to the party but I'm always game for a challenge! To be honest this one was more difficult than I anticipated. Looking forward to the next! The movie is Madagascar BTW.

TimothySanty_0-1682676636752.png

 

0 Kudos
3,791

Nice work 😺 Please do the others, too




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

johna69
Product and Topic Expert
Product and Topic Expert
3,775

Movie I already saw someone elses answer... Madagascar ..... 

 

Screenshot 2023-04-30 at 11.33.09 PM.png

0 Kudos
3,739

Thanks for participating 😺




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

P000636
Active Contributor