How to limit button clicks? ( Limit downloads )

Hey,
I have an RG for Ebooks.
How can I limit the number of e-books a user gets to download per day.

Like if I have
5 Ebook A,B,C,D,E

If the user downloads 2 e-books A & B, I wanna block him from downloading more for 24hrs.
After 24hrs they get activated again. It’s more like quota

Create a data field in the user data type and make it a number. Add to the download button workflow that it makes changes to the user and adds 1 to the data field you created. And also add an only If to the entire workflow that makes it only occur if the current user’s download counter data field is less than 5. You should also make a new workflow that resets the current user’s download count to 0 every 24 hours but I’m not sure how exalcty you can do the every 24 hours since I’ve never don’t that type of thing before and don’t know how it works

Well here we will face the problem that than user will press on 1 button twice it will count as 2 books.

You mean wanting to download the same ebook on 2 different occasions?

I mean there is a button that adds +1 to limit number(user data) as you suggested.(and that’s the right answer)
If I will press this button twice, data will show that I downloaded 2 times, while I didn’t.

I believe you should add hide in workflow to avoid it.(or set state to make it non-clickable)

What if there’s a new data field in the user which is a list of ebooks. And the download button has 2 workflows. In the first one, there’s an only when that only happens if the current cell’s ebook is not in current user’s list of downloaded ebooks, in which the +1 is added to the counter and the ebook is added to current user’s list of downloaded ebooks. In the second workflow, it occurs if the ebook is in the user’s downloaded ebook list, and if that’s the case, then all the actions occur except the +1 on the counter. Or maybe what you suggested, depends on how OP wants the system to work

1 Like

That’s very good sollution.

create a new data type called “ebook download“ this should include an ebook as a field

Now when a user clicks the download button in the workflow create an “ebook download” add an only when action “do a search for ebook download created by current user, advanced filter:this ebook’s download’s creation date - current date / time < 24 hours :first item is empty (basically only create a new ebook download event if one hasn’t been created for this book already)

Now add “and” to this only when to include do a search for “ebook download” advanced filter again to get less than 24 hours ago downloads :count

Add this only when to the download action

I like your solution. It might be lighter weight and faster than creating a download ebook data type and creating this data as an event on download click with only when conditions.

Is it okay for the user to download the same Ebook 5 times?

How did you displayed the e-books?

This topic was automatically closed after 70 days. New replies are no longer allowed.