Score:0

Webform entity reference view?

gb flag

I want to have a field to select a webforms within a paragraph using an entity reference field in the "Views: Filter by an entity reference view" reference mode, so that I can reduce the number of options particular authors see.

However, "webform" is not a valid selection when I go to create a view. I see "webform submissions" but not "webform." Is there a different webform submodule that I have to turn on, I am puzzled why this is not available, so wonder if something is going on on my site.

(This is on a Drupal 9.5 site, using webform 6.1.3)

  • The webform_views module does not seem to provide the integration which is what I would expect. It also seems to be related to submissions.
  • I thought I could use that module to create an Entity Reference list of views from the submissions, using a relationships (submitted to: content) and then aggregating on the individual forms. This works except that in order to work it has to be attached to an entity already (the submitted to content).
Kevin avatar
in flag
Is this because Webforms are configuration entities?
Adrained avatar
gb flag
Ah, yeah that makes some sense. Will give this a try https://www.drupal.org/project/config_view
Adrained avatar
gb flag
Alas. My site did not like that config_view module (at least locally) out of memory errors :-(
in flag
"I want to have a field to select a webforms within a paragraph" - Webform does provide a webform field which allows you to select forms. It's a special kind of entity reference field that references webforms. It's pretty basic, no programmatic/contextual filtering. You can select which forms appear iirc. You might want to play with it to get what you need. See `\Drupal\webform\Plugin\Field\FieldType\WebformEntityReferenceItem`
Adrained avatar
gb flag
Thanks Joseph. I am using that field, but it shows all the forms for all users. There isn't a way to select the forms to choose from. Thanks for the pointer to the plugin though. Will see if I can manage anything with that.
Adrained avatar
gb flag
Oh, actually, I do now see where you can choose the forms to select. It is on the "Manage Form Display" page. That doesn't solve my use case where I only want to show them their own webforms, but might be handy in other instances.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.