I've been not very experienced with CiviCRM. I try to get CiviCRM custom fields displayed in Views. I've installed Drupal 8.9.3., CiviCRM 5.28.3, CiviCRM Entity 8.x-3.0-beta1.

Drupal and CiviCRM run on different databases on the same server with the same database user. In added the array with the links to the correct database to civicrm.settings.php as described in https://docs.civicrm.org/sysadmin/en/latest/integration/drupal/views/.

In Drupal 7, when I created a view(user) I was offered different CiviCRM fields. This doesn't happen in my Drupal 8 installation.

Besides when In try to create a view(contacts) I get the following error message:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'usr_p550866_1.civicrm_contact' doesn't exist: SELECT civicrm_contact.id AS id FROM {civicrm_contact} civicrm_contact LIMIT 11 OFFSET 0; Array ( ) 

(usr_p550866_1 is the database for Drupal)

Is this a problem with Drupal 8 or do I anything wrong?

Your help would be appreciated very much.


1 Answer 1


You need to add it in settings.php not civicrm.settings.php. once you add them in settings file clear Drupal cache

  • Thank you very much for your fast answer. This served the problem with the different databases,
    – paul77
    Sep 11, 2020 at 4:23
  • What remains is my starting problem. I now can display the structure of custom fields in Views but I haven't found a way to display its contents. What I want is to have a view that display the content of several custom fields that belongs to a certain Durpal user. Can anybody help here?
    – paul77
    Sep 11, 2020 at 4:27
  • There was probably I misconfiguration of civicrm, not everything works as expected.
    – paul77
    Sep 14, 2020 at 19:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.