CSV Export with Nested View Data

By: Vince Dimanno | Asked: 10/10/2023
ForumsCategory: How-toCSV Export with Nested View Data
Vince DimannoVince Dimanno asked 7 months ago
I have a view that exports fine to CSV, but it doesn't include the data in the columns where I pass nested data from another view. In the columns I have this shortcode: [display-frm-data id=x pass_field="[y]"] The data shows correctly onscreen and in PDF exports, but not in CSV file exports. Is this possible or does the CSV only export the single form entries?  (Note: I have tried with and without parameters and there is no difference.) Thanks!
3 Answers
Victor Font answered 6 months ago
Have you asked anyone in Formidable Support? Since you're exporting through a view, I'm assuming you're using the Export View as CSV add-on and all the views in question, nested or otherwise, are old-style HTML table views. I don't know if this add-on supports nested views or not. As community volunteers, we have access to two resources, the same public documentation that you have access to, and our own personal experiences. I've never seen a question with your requirement asked before. The most common problem with exports through this add-on is that the HTML tables are not constructed properly. If there are mismatched HTML elements it sets everything off. That's what you have to check as the developer. This is hands-on work. To know if the add-on supports nested views or not requires an intimate knowledge of the code itself. There's nothing in the Formidable KnowledgeBase that suggests either.That's why I asked if you contacted Formidable Support. I think they're the only ones that can really answer your question in a timely manner. Let us know what you find out.
Vince DimannoVince Dimanno answered 6 months ago
Hey Victor! Thank you for that feedback. I am quick to contact support for issues when required, however, they do often ask if I've put it out on the forums. To be honest, when a community member has solved a problem before, it is usually quicker to get to the solution than to proceed through the standard support request system.  I will put my question to support and then post their answer here.  Thanks!!
Vince DimannoVince Dimanno answered 6 months ago
I resolved this issue. In fact, it wasn't an issue as the data was being exported. However, upon viewing the CSV file, the data in the nested view columns was not visible. This was because of the automatic adding of paragraph tags when building view in a grid. The solution was to add: wpautop=0  to the nested view shortcode in the main view. This removes the spaces and you can now see the data in the exported file.  I feel a bit silly with this one. I would consider myself a pretty sophisticated user of FF with many projects under my belt. However, I've never come across this before. It is referenced in the documentation, but not in terms of having any effect on an export file. So, while I feel a bit stupid, I hope this helps someone else.  Cheers!

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community