Create items quantity counter

Hi all, first time posting. I am trying to create a simple counter like this:

image

Where the user clicks on either the “+” or “-” a number of actions should occur:

  1. When the “+” sign is clicked, the counter (0 in the middle) should increment by 1.
  2. A new record should be added to the order (see collections below).
  3. When the “-” sign is clicked, the counter should decrease by 1 and a record should be deleted from the order.

My current set up is a list:

image

The current actions I have when the “+” sign is clicked are:

The current actions I have when the “-” sign is clicked are:

image

I should be able to delete the current order item, but this is not an option for me to select. Not sure why?

But I’m not sure if this is correct either as nothing happens when I click the “+” or “-” button. No records are added or deleted.

I followed the instructions in this post here:

But unfortunately I couldn’t get it to work for me.

I am willing to post more screenshots of my collections but I am limited as this is my first post.

Could someone please point me in the right direction to get this working?

Hi @mattm_14 ,

Maybe this post is helpful,

Hi @Yongki ,

thanks for that post. I also saw that one and spent time trying to apply to my issue. But unfortunately this didn’t work also.

Can you create cloneable app of what you have been trying ?

Below that post, there is a video example.

Sure. As I am new here, I am not quite sure how to do that. Any tips you could provide or any documents on how to that you could point me towards would be great!

You can click the red arrow and share the url of your previewer.

many thanks @Yongki!

Here is the url: app_mobile

The screen where I’m stuck is the “All items 2” screen.

Please let me know if you can access it ok?

I can access it, will let you know if I make progress.

@mattm_14 ,

Here is the revised cloneable app,

https://previewer.adalo.com/0114740a-ff34-4819-9fdb-6f2dae458b61

Screen Recording 2021-12-22 at 2.37.57 PM

It is in “All items 3” screen now.

1 Like

@Yongki thank you so much!

But now when I go to login, I am unable to (on the clone app). Should I need to change anything for that?

Or is there a way to copy only “All items 3” to my original app?

I change the password to be just “t”.

If you want to copy paste the screen in different apps, you need to open 2 browsers for that.

But I will suggest you to create from scratch and follow along.

I will definitely do that! Thank you! I will see how it goes and come back if I can’t work it out.

Also - I have a follow up question, somewhat related. As I am new here, should I start another separate question? Is that the best approach?

Different thread for different topic is a good idea, others can help you as well.

perfect, thanks!

Sorry to ask another question on this, but I forgot to include in my original post that I require the price to be updated also when an item is added (so item price * item count). E.g. if one item costs $9, then for 1 item count, cost is $9, 2 item count, cost is $18 and so on.

So in the highlighted field here:

image

I tried this formula:

But unfortunately this didn’t work. I am not sure which part I have got wrong?

You can add 2 more fields in order items collection and update there whenever both + icons are clicked.

It is better to prepare as much as field we want it to display or filter, rather than use formula, it doesn’t mean we avoid formula, but just displaying whatever already saved is easier.

I see, thank you!

Sorry to ask, but what 2 fields should I add? I am still new to all of this but learning quickly!

Price and Total, those that you want to display.

No worry, we are all still learning. :smiley:

1 Like

ah, of course!

I have now done that. However, I just found that when you click the “+” symbol, the counter goes up which is fine. But when you click on the “-” symbol and the number is reduced to 1, the entire group disappears. Is there such a way to keep it there if the item count is 1? And if the “-” is clicked again (therefore reducing the total to 0), then it disappears?

The item at top is showing quantity as 1.

Are your actions similar like these ?

It is better to support with screenshot too.

yes, apologies for missing the screenshots in the last post. I have similar:

image

It still disappears when the item count is 1?

On delete item, I have:

1 Like