cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Build Apps - Set App Variable

06-04-2025 3:25 PM
1134 views 2 comments Go to solution
0 Likes
Subscribe

Hi, 

I have an app variable called 'Purchase Order Item' that is a list of objects. I have 2 pages ie. Item Details and Item Overview. Item Details page takes user inputs for an item and Item Overview page displays all the items as a list.

I have created a button 'Add Item' on the Item Details page so the item can be added to the Item Overview Page. In the logic canvas of the button, I have used 'Set App Variable' function to update my item list on Overview Page. This function is not appending to the existing items but rather replacing it. For example, if there is item 1 on Overview page and I try to append item 2 to it from Details page, it is replacing item 1 with item 2 rather than appending. Could you please suggest any ideas to resolve this?

Thank you. 

Kind Regards,

Praneetha

#SAPBuildApps

0 Likes
View Entire Topic
shrinivasan_neelamegam
Developer Advocate
Developer Advocate
0 Likes

When you click on the "Set App Variable" logic function, on the right panel, you would see "Variable name" and "Assigned Value". In the "Assigned value", you have to choose "Formula" option. A formula editor pop up shows up. You can use the WITH_ITEM formula for this case since you want to append an item to a list. The item should be of the same data type as the list elements.

For eg: Lets say you have a list1(list of objects) which contains the items displayed on the overview page and you want to add item2 to list1 on the click of a button, the formula you would use in the formula editor would be:

WITH_ITEM(appVars.list1, item2) -> change the list1, item2 according to your variable names

The Formula editor shows how WITH_ITEM should be used, on the right side with examples.

0 Likes
Thank you for your swift response, Eshrinivasan.