- Issue created by @alastairworters
- 🇩🇪Germany jurgenhaas Gottmadingen
A webform is a config entity, describing how a form should be build, when a user is asked to fill that in their browser. The result of such a submitted webform is then a content entity of the type
webform_submission
.Your description above sounds like you want to create a webform_submission content entity with ECA, right? If so, this issue belongs to the ECA Webform module. And then, once you've created the content entity, you don't want to set field values, as the webform submission field values are webform data, not fields of a content entity. Yes, that's confusing, which is just because it is unfortunate, that webform fields can be mixed and matched with entity fields, which they aren't.
Side-note: using such a big screenshot of a model is not really helpful for support cases. It's better to create a simple model and export that from the ECA overview page. Such models can then be imported into a fresh Drupal site and are much easier to review then a screenshot.
- 🇬🇧United Kingdom alastairworters
Apologies for the large screenshot.. I only meant to show visually what my issue was, however I will follow your instructions from now on.
To answer your question, I am using ECA to create a webform node, referencing from a central webform, rather than creating a webform_submission.
The model I have created successfully creates a webform node. I am also able to pull through the file URL as a token from the referenced entity and can display the url with in a message to the user. However I am unable to pre-populate a text field within the newly created webform node using the token that contains the URL.
Reading through the documentation and watching your tutorials I thought that it would be a case of setting the field value of the new webform entity placing the assigned token holding the file URL into a field within the webform node.
- 🇩🇪Germany jurgenhaas Gottmadingen
I'm not familiar with "webform nodes", hence I'm not sure what that exactly is.
The "field" you want to populate, is that a node field? Or is it a webform field? If it's the latter, you can use the field API, e.g. "Set field value". For webform fields, there is a completely different data model and there are some ECA actions available in the eca_webform module, that are able to get and set webform data. They are called webform fields in the UI, but they are not fields in terms of node fields.
To further debug your problem, I'd suggest to forget about the URL in a token. You may try with a fixed string value first. When you managed to pre-set the "field" value with that fixed string, the next step could then be to replace that with a token.
- Status changed to Postponed: needs info
10 months ago 4:16pm 21 February 2024 - Status changed to Closed: outdated
9 months ago 2:03pm 2 April 2024