How can I log the flags users put, then auto unflag them? I used this link to set up a UserPoints Store:

Drupal 7 - How to Set up a Simple UserPoints Store.

I need help finishing one thing:


When user flags item
some code starts working and logs the fact that this specific user just flagged this specific page(content)
Once this information is logged somewhere.
the page(content) that the user see's as [Already Flagged] needs to automatically unflag.
So that user can flag it again if he/she wishes.


If you look in the link above it can be understood that flagging a item(page/content) deducts points from the UserPoints system. As soon as the user presses flag this they get the option to type in the quantity they would like to "purchase" or flag. I need this quantity logged too.

In short, this is an example of how it should log:

User | Time/Date | Quantity |  Page    
-----+-----------+----------+--------
id2  | 8/18/2016 |     3    | /node/9
id7  | 2/13/2016 |     1    | /node/5
id4  | 4/28/2016 |     1    | /node/1


I hope it makes sense. It would make more sense if you take a look at the info in the link.
The Log 

Userpoints transactions are automatically "logged" in that Views can display them with all required data. So if I understand the question correctly, flags is irrelevant here in terms of logging as you just want the userpoints transactions.

Create a "userpoints transactions" view.. Not "content" or "user".


Add a relationship for Userpoints Transactions: User  
Add fields for
(Users) User: Uid (Uid),
Userpoints Transactions: Timestamp (Timestamp),
Userpoints Transactions: Points (Points) and
Userpoints Transactions: Entity ID (Entity ID) (according to your link, this should be the node id)
If you have more than one category of userpoints, you can add a filter for Userpoints Transactions: Category


Automatic Unflag

It sounds like in your link, Business Rule 2: Unflag an item is unneeded in your case? I'd just change this to a rule where the the flag is unflagged and then redirect to the node / page if needed. I'm not really sure what the requirements are here.