150
Views
5
Comments
Add quantity of an item
Question
Application Type
Reactive
Service Studio Version
11.53.13 (Build 61176)

I am creating a food delivery app. I have added a quantity attribute to Food Entity to mention how many foods should be ordered. I have added to buttons to increase or decrease the value of the quantity attribute.

When I click on Order it is not storing the latest value of the Quantity Attribute. It dispalys the default value 1.

So can anyone help me with the client action flow to store and display the latest value of the attribute.

Thankyou! 

2020-11-13 07-48-15
Khuong Truong

Hi @Dinesh Kumar ,

I think in this case if you can share your .oml, it will be easier for community to help you.

Regards,

Khuong

UserImage.jpg
Dinesh Kumar

Thankyou for replying quickly. Here it is...

Tomato.oml
UserImage.jpg
vikas sharma
Champion

Hi Dinesh,

I think for this you have to maintain a list to hold the values.

Like there is a list of 5 items added by customer in the cart. Now in this list there will be a variable to hold the value of quantity. Quantity input will be bind with the variable. Now when user change value it will be updated in that variable for that position.

regards

UserImage.jpg
Dinesh Kumar

So, I need to create a different entity for Cart and add the quantity attribute over there. It will display the value.

But I need to make the attribute to return to its default value 1 after the particular order is completed. Do you have any idea for that?

2025-09-25 14-38-22
Lokesh Kumar Yadav

Hi Dinesh,

I understand your doubt first you can assing the local variable in current id

I attached the oml file it will help you

ChallengeForum1.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.