Capture Last visited info in a table

  • 0
  • 1
  • Question
  • Updated 2 years ago
I have an employees table where I record every user and manage their access. Is there a possibility if I could have last log in detail in this table from the users tab. The reason I need to do is to capture depts maintained in employee table for users which cannot be accessed from anywhere else.
Photo of Arshad Khwaja

Arshad Khwaja

  • 3,132 Points 3k badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
If you are looking to do this beyond what it show is the user table, you can make an api call via a server script.  

https://help.quickbase.com/api-guide/index.html#userroles.html#Response_Values

Sample XML Request
POST https://target_domain/db/target_dbid HTTP/1.0
Content-Type: application/xml
Content-Length: 77
QUICKBASE-ACTION: API_UserRoles
<qdbapi>
   <ticket>auth_ticket</ticket>
   <apptoken>app_token</apptoken>
</qdbapi>

Sample response
<?xml version="1.0" ?>
<qdbapi>
   <action>API_UserRoles</action>
   <errcode>0</errcode>
   <errtext>No error</errtext>
   <users>
      <user type="user" id="112149.bhsv">
         <name>Jack Danielsson</name>
         <lastAccess>1403035235243</lastAccess>
         <lastAccessAppLocal>06-17-2014 01:00 PM</lastAccessAppLocal>
         <firstName>Jack</firstName>
         <lastName>Danielsson</lastName>
         <roles>
            <role id="12">
               <name>Administrator</name>
               <access id="1">Administrator</access>
            </role>
         </roles>
      </user>
      <user type="user" id="112245.efy7">
         <name>Ivar Boneless</name>
         <lastAccess/>
         <lastAccessAppLocal/>
         <firstName>Ivar</firstName>
         <lastName>Boneless</lastName>
         <roles>
            <role id="10">
               <name>Viewer</name>
               <access id="3">Basic Access</access>
            </role>
         </roles>
      </user>
      <user type="group" id="3">
        <name>Everyone on the Internet</name>
        <roles>
         <role id="10">
            <name>Viewer</name>
            <access id="3">Basic Access</access>
          </role>
        </roles>
      </user>
   </users>
</qdbapi>
You will ned to define your code and frequency to check.

Curious as to why you don't use the native user table, or use that "Last Accessed" date?
Photo of Arshad Khwaja

Arshad Khwaja

  • 3,132 Points 3k badge 2x thumb
Thanks. As I did indicate I have a large user base whose access is driven through a table where I have got all other employee info which is normally not captured in the users table. For example, their title, dept etc. 

Could you do some hand holding in relation to above.  Not too sure how to use this.