Forum Discussion

rwm's avatar
rwm
Advisor
10 years ago

Previous visit time for a user

I would like to build a component for my users that retrieves some data from the time they last logged on the community.    Problem is, the user field "last_visit_time" is updated with the current time as soon as they login, becoming "now".   Retrieving data based on that would be useless since it would return nothing.

 

So, given a user that just logs into the community, is there a way to determine when they logged in previously - prior to the current login session?

4 Replies

  • OlivierS's avatar
    OlivierS
    Lithium Alumni (Retired)
    10 years ago

    rwm what data do you want to retrieve? Maybe you don't need the last login timestamp ... 

  • PaoloT's avatar
    PaoloT
    Lithium Alumni (Retired)
    10 years ago

    Hi rwm

     

    you could work with Services to implement a custom user profile field which saves that data (date of previous login). You can then build a customization that uses the custom profile field to retrieve the data.

     

    Cheers,

  • rwm's avatar
    rwm
    Advisor
    10 years ago

    OK thanks, I thought so.   I know Pro Services can do almost anything but I need a solution that doesn't cost extra money.    I could pick an arbitrary amount of time or even give the user options for how far to look back, I was just hoping to automate it for them.

  • PaoloT's avatar
    PaoloT
    Lithium Alumni (Retired)
    10 years ago

    Hi rwm

     

    To simply add the custom profile field, you should be able to get it done via Support.  Any work on top of that would require an engagement with Services, but if you are willing to experiment and develop the customization yourself, that may be a good solution for you.

     

    Thanks,