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: 

There is a nice way to clear List of Objects in SAP BUILD APPS (AKA Appgyver)?

josueqsbo
Explorer
0 Kudos

josueqsbo_0-1711857652309.png

Hi dear experts.

I am doing some mix between a lot of Youtube tutorials and now i am facing some troubles with List of Object.

I want to present a list of selected Items on my app. the selection takes place in a second Page with the help of a "Add New" Button.

For this i use an App Variable "List of Objects" to store the selected items in the second page and present this list in the first page.

Everithing is working for me but i want to add logic to my app to delete the "List Of Object" when you leave the first page or when you confirm the creation of the document in the fist page.

is there a way or function that can helpme to do this?

the only way i am thiking is to do several "Set App Variable" flow functions

IF(IS_EMPTY(appVars.LISTOFOBJECTSVAR)==true,appVars.LISTOFOBJECTSVAR,WITHOUT_ITEM(appVars.LISTOFOBJECTSVAR, LAST_ITEM(appVars.LISTOFOBJECTSVAR)))

I thik there will be a smarter way to do this

3 REPLIES 3

josueqsbo
Explorer
0 Kudos

discovered the IF Flow function. I think with this logic i can continue my journey.

josueqsbo_0-1711858587979.png

i am leaving this here because there are some lost data from old forums that explain this.

Dan_Wroblewski
Developer Advocate
Developer Advocate

If you want it empty, why can't you just set it to empty or [ ] ?

This is what we do in our SAP Build CodeJam, when we want to delete the cart of items (or you can do via formula).

Dan_Wroblewski_0-1711956836008.png

If you want to delete all records from, for example, on-device storage entity, you may need a loop like this.

 




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

josueqsbo
Explorer
0 Kudos

This is great i as simple as i wanted.

Just putting "[]" (without the quotes) and tats all.

i will stay tuned with the CodeJam if you stream something.

sorry if my English isnt verry clear i am Peruvian and im not fluent in english