Body: <p>I'm trying to search our CiviCRM database for contacts related to a specific other contact and order the results by date of their last CMS login. I've looked at Advanced Search, Search Kit, and Data Processor and I can't seem to find a way for any of them to pull in that information from the Drupal database. Is there anything I'm missing with one of those, or is there some other solution that I can use to do this?</p>
  <p>I did find <a href="https://civicrm.stackexchange.com/questions/21438/how-to-see-how-often-do-people-log-in">this question</a>, which suggests it might be possible using Drupal Views, but at the moment we don't have CiviCRM data exposed to Views, and we're (very slowly!) working on migrating off Drupal 7 to WordPress, so I'd prefer a solution that can also be made to work in WordPress if possible.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-13T19:56:05.670Z
Comments.Text: I would be using Views - and getting civi data in Drupal Views should be a no/low effort. If you are in a single db then it should just 'be there'. if you are using separate dbs then just copy / paste the list of civi tables in to your drupal settings.php
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-14T08:39:23.757Z
Comments.Text: As mentioned above, Views is exactly how you'd need to do it. Login information is in your CMS's database, not CiviCRM. All CiviCRM really knows is the user id of the login, and that's because they're tied together between the two databases. I haven't used WP enough to know if they have something similar to Views.
Comments.UserDisplayName: Jenni Simonis
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-23T13:30:08.367Z
Comments.Text: Thank you both. So does that mean there's effectively no way to do this on WordPress?
Comments.UserDisplayName: somnolentsurfer
Tags: <search><cms-integration>
Title: Order search results by last login
ThreadText: # Order search results by last login
  
  (Asked by: username_0 on 2023-06-13)
  
  I'm trying to search our CiviCRM database for contacts related to a specific other contact and order the results by date of their last CMS login. I've looked at Advanced Search, Search Kit, and Data Processor and I can't seem to find a way for any of them to pull in that information from the Drupal database. Is there anything I'm missing with one of those, or is there some other solution that I can use to do this?
  
  I did find [this question](https://civicrm.stackexchange.com/questions/21438/how-to-see-how-often-do-people-log-in), which suggests it might be possible using Drupal Views, but at the moment we don't have CiviCRM data exposed to Views, and we're (very slowly!) working on migrating off Drupal 7 to WordPress, so I'd prefer a solution that can also be made to work in WordPress if possible.
  
  **Tags:** search, cms-integration
  
  > **Comments:**
  > **username_1**: I would be using Views - and getting civi data in Drupal Views should be a no/low effort. If you are in a single db then it should just 'be there'. if you are using separate dbs then just copy / paste the list of civi tables in to your drupal settings.php  
  > **username_2**: As mentioned above, Views is exactly how you'd need to do it. Login information is in your CMS's database, not CiviCRM. All CiviCRM really knows is the user id of the login, and that's because they're tied together between the two databases. I haven't used WP enough to know if they have something similar to Views.  
  > **username_0**: Thank you both. So does that mean there's effectively no way to do this on WordPress?  
  
  ---
  
  ## 0 answers
  
  