Hi all! I would like to add a login counter in the users table.
Any idea on how to do it?
Thanks!!
Hi all! I would like to add a login counter in the users table.
Any idea on how to do it?
Thanks!!
Hi!! No ideas on this one? please I need help on this one.
Thanks!
Set a number field in the Users database, set a Rule on your Login form to assign the “Login Count” to Arithmetic of +1
Whoops… I have some similar counts in place with other forms, I had not considered the lack of Submit Rules on a Login form. Is there some sort of ‘first action’ required by the user immediately after logging in, that could be counted instead? For example, my Users have to select a ‘Ticket’ from a ‘Profile’ form to begin using the app (and each ticket they change tickets), and I count how many tickets they open in this manner.
Still curious about a solution for this one.
I believe we can achieve this by creating a custom login-log table. I implemented it in my own way, and it might be helpful to you.
Create Data Table “Login Log” which has 2 fields.
Add Field : Equation → Count, Name: “Login Count”
Pipes → Install “Tadabase Rest API” → Copy Code of “Save New Record” pipe
Goto “Page Builder → Login → Javascript” Tab add below code. for you knowledge “login_success” will trigger everytime when user login successfully.
TB.render('component_4-login_success', function(data) {
});
TB.render('component_4-login_success', function(data) {
TB.triggerPipe('PIPE_ID',
{ tableId: '{LOGIN_LOG TABLE ID}', field_id: '{LOGIN_LOG -> USER FIELD SLUG}', field_val: data.user.id },
function(type, response, xhrRespone) {
}
);
});
Everytime user loign it create new record in Login Log table and automatically show total count in each user table.
@christopher93 Thanks. It works well, but I tried it several times and then it works too well. Which means every time I login the code gets repeated, so I get several entries in the login table.
First time 1 entry, second time 2, etc…
It seems that logout does not delete this code snippet in memory.
Do you recognize this behaviour?
And for getting time/date a table rule needs to be installed