Hello there, I am trying to achieve what I imagine is a very common use case, but unfortunately I cannot find many resources. I am trying to gather data from a user, and use those data to create objects that can be referenced for display or manipulation. I have tried using the webform module as the data collection and object retention portions, but I run into problems with the views module. When creating a view in the webform submission data context and querying the results of the webform I created, the "All values" field does not return anything. Another possibly related problem is when I try to use the views data export module to try to export the data as either csv or xml, the field labels are not present, although it is pulling the values. Am I going about this problem in the wrong way? Did I miss some resources that explain how to do this? Thank you in advance.

Comments

Hi colbycat.

Does the "Webform submission data: Value" field work for you? I also get nothing when I use "All values". This seems to be a bug. I found this Drupal issue that may address it. You may want to open an issue in the Backdrop's Webform issue queue.

As for data export - I've never used that in combination with Webform, but because of the way Webform values are stored in the database, I'm not surprised this doesn't work. It's easier to just use the native Webform UI to download found at node/NID/webform-results

Webforms are problematic because of their architecture. It's an ancient design that was created before the Field API was added to Drupal 7. I try to use it for very simple things. It looks like your use case is complex, so I would consider going another route:

- Porting D7 EntityForm, which use the Field API architecture

- Using nodes to collect your user's data (this implies giving permission to those users to create nodes) and then using Views etc

- Creating a custom entity, and using a form accessible to your users to submit values. Custom entities play nice with Views and Field API. So, this would be like #2 above, but without the overhead stuff created by nodes

If you are interested in creating a custom entity, you can take a look at Basic Entity Plus Example, which uses Entity Plus (called Entity API in Drupal 7) to illustrate how to create a fully functional custom entity and its forms.

Hello there argiepiano, and thank you for your response. Yes, the Webform submission data: Value field does indeed work. Also thank you for the alternative solutions, it seems like I would have to do more work to make webform work. As per your suggestion of creating a custom entity, is there a resource that shows the steps to creating a form that allows users to submit entities of the created type? Would it be webform or a custom form? I have my custom entity up and running but I'm stuck on the form part. Thank you!

>As per your suggestion of creating a custom entity, is there a resource that shows the steps to creating a form that allows users to submit entities of the created type? Would it be webform or a custom form?

A custom form. If you look at the entity plus example module I posted above, it provides a creation and edition form that your users can use (you have to give them permission). Or you can create a custom form and save the values upon submission.

BTW, someone is porting the module Entity Construction Kit, which provides a UI to create custom entities. Not sure if it provides the forms too, or whether you have to code your own form: https://github.com/herbdool/eck