I want to store the amount of times someone clicks the button in my data?

Hi,
In my project when someone clicks get coupon to obtain a coupon! I want a method of storing the data for every time the coupon is downloaded so the owner of the coupon can see on a weekly basis how many people viewed the coupon, or even better still if someone knows a way of displaying this information on the same page as the button,so both the user and the owner can see who downloaded it,
Kindest Regards,
Anthony!

The best mean of making this I see to create a Coupon thing with TimesDownloaded field (int) and UsersDownloaded field (list of Users).
So on the page you can easily make a request of these fields and display needed info.

I see what your suggesting where should I go from here?
, Anthony.

The logic you’re looking for is:

Times downloaded = Times Downloaded + 1

I’m not sure how your data is structured, so that would impact how you actually change the value, but in general, you want to set the Amount equal to the Amount + 1. What other fields do you have on the “School Coupon” thing?

1 Like

Ah, I know what your getting at, here is what my data structure looks like,
Anthony.

@anthony1
Is it a popup for creating Coupon or updatin it? (TimesDownloaded)
It seems that the first case. Then you should write 0 in this input. (Coupon hasn’t been downloaded yet) Or, alternatively, you can set 0 as default value for this field in Data->Data Types.
Then you add another button (download coupon), where Action is Data(Things)->Make changes to thing. Here you add 1 to TimesDownloaded.

I’ve filled out all of the above, and I have got stuck on this bit below, how do I go about adding 1 to TimesDownloaded

This is where I’m stuck now

After “first item” can you do a + 1?

@anthony1
See my example. Here I add 1 to User’s Points.

In your case you should do TimesDownloaded = Parent group’s School Coupon->TimesDownloaded + 1. At least as I see your data structure.

PS: Or TimesDownloaded = Search for School Coupon’s:first item->TimesDownloaded + 1. May be like this, if you need that search for coupons remains.

Oh now I have figured out how to do it! Thanks for much for giving the time to help out!
Kindest Regards,
Anthony!

@anthony1 Not at all! :wink:

Hi AnFlare,
I have ran into trouble again regarding this post, I changed around the names of fields in the database and now my application fails to store the amount of clicks and post them underneath the picture, it was working perfect yesterday, I may have left something out, can you spot the flaw from these screenshots,
kind regards,
Anthony.

@anthony1
Click on red “6 issues” and make a screenshot what it says.

I fixed all six issues and the problems still persists

You seem to have a lot of searches, and a lot of “firstitem” for something that should be fairly simple.

Worth having a look at your database to try to make it work in a simpler way for you.