Support for Views Custom Table

Created on 14 February 2025, 16 days ago

Problem/Motivation

We are using MS excel and VBA to send emails out via Outlook, however the latest version of Outlook, known as New Outlook does not support VBA at all. Hence would like to create sort of workaround.

We have tried to create a custom table in our database and using VBA updating this table with the data so now we need to send them out using Drupal email (easy email).

I can load this table using awesome module " Views Custom Table β†’ ", so I can create a view in Drupal and check.

Now I need to use ECA to query that view and send emails out based on rows. However it looks like ECA does not read that rows.
I have used following example "Sprint: ECA and Views #drupal" but when I render/query view and try to print it I am not getting any rows, looks like in this case ECA is not loading view correctly, mostly because it is not a drupal core one.

Is it possible to do anything so I can list view with ECA and based on loop send emails out (of course email address must be in table) ?

πŸ’¬ Support request
Status

Active

Version

2.1

Component

Documentation

Created by

πŸ‡ΈπŸ‡°Slovakia coaston

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @coaston
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    The views API in Drupal is designed to work with content entities. And content entities only. ECA is using that API to receive a list of content entities to deal with them.

    Sometimes, it's felt that this views API is a limitation that contrib modules try to overcome. There is one that also wants to make config entities available to views. It mostly works, but it breaks a lot as well. Doing some custom table enhancement sounds like pretty much the same issue.

    I wonder if you couldn't define a custom entity type instead and load your data into the entity data table. That way, you would have full views support and no issue with any other component in Drupal that also follows APIs.

  • πŸ‡ΈπŸ‡°Slovakia coaston

    Thank you jurgen,

    If you mean to create a content type in drupal with fields and use for example feeds module to load them - this would require additional step in between as vba cannot interact with drupal server directly to store for example json because of firewall, vpn and proxy in our case.
    So we can use just mysql and using insert into table commands is quite difficult in drupal as it has many references and many tables as every field has 2x. This could be option but wanted to try any simplifier one thats why i wanted to use that views custom table one but did not expect that eca wont work with..

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    using insert into table commands is quite difficult in drupal as it has many references and many tables as every field has 2x

    That's not correct. If you build your own entity type just with base fields, not in the UI but in code, then you get a single table with one column for each field. You can then easily import with mysql into that table and have full entity API support.

  • πŸ‡ΈπŸ‡°Slovakia coaston

    thank you,

    Will try this method, it sounds less complicated.
    I guess this can be closed.

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen
Production build 0.71.5 2024