# Export to CSV shows blank fields

**URL:** <https://discuss.elastic.co/t/export-to-csv-shows-blank-fields/292218>\
**Category:** Kibana\
**Created:** [December 16, 2021, 7:52pm UTC](https://discuss.elastic.co/t/export-to-csv-shows-blank-fields/292218 "2021-12-16T19:52:33Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richard\_Schroeder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richard_schroeder/32/86153_2.png) [@Richard\_Schroeder](https://discuss.elastic.co/u/Richard_Schroeder)\
**Post date:** [December 16, 2021, 7:52pm UTC](https://discuss.elastic.co/t/export-to-csv-shows-blank-fields/292218/1 "2021-12-16T19:52:33Z")

</div>

I'm exporting data from a view created from the discover module. In the data there is a field that is filled only in some records, less than 10% of records have this field filled. When I filter or export the entire listing, the field is not filled in the csv file. If I export the list making a filter to bring only records that have the field filled in, then the csv list is exported correctly with the field filled in.  
Analyzing the logs of kibana and Elasticsearch no errors are presented that could be related to this problem.  
I'm using version 7.16.1 of Elasticsearch and kibana.

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [December 16, 2021, 11:05pm UTC](https://discuss.elastic.co/t/export-to-csv-shows-blank-fields/292218/2 "2021-12-16T23:05:01Z")

</div>

Are there any errors in the Kibana server logs?

Can you provide a dataset with mappings that reproduces this problem?

---

<div class="post-metadata">

**Author:** ![Richard\_Schroeder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richard_schroeder/32/86153_2.png) [@Richard\_Schroeder](https://discuss.elastic.co/u/Richard_Schroeder)\
**Post date:** [December 17, 2021, 11:59am UTC](https://discuss.elastic.co/t/export-to-csv-shows-blank-fields/292218/3 "2021-12-17T11:59:37Z")

</div>

The error below occurred 69 times. And this is the number of missing values.

{"type":"log","@timestamp":"2021-12-17T08:48:06-03:00","tags":["error","plugins","reporting","csv\_searchsource\_immediate","csv\_searchsource\_immediate","execute-job"],"pid":2049,"message":"TypeError: Cannot read properties of undefined (reading 'convert')\n at /usr/share/kibana/x-pack/plugins/reporting/server/export\_types/csv\_searchsource/generate\_csv/generate\_csv.js:169:42\n at CsvGenerator.generateRows (/usr/share/kibana/x-pack/plugins/reporting/server/export\_types/csv\_searchsource/generate\_csv/generate\_csv.js:256:35)\n at CsvGenerator.generateData (/usr/share/kibana/x-pack/plugins/reporting/server/export\_types/csv\_searchsource/generate\_csv/generate\_csv.js:390:9)\n at runTask (/usr/share/kibana/x-pack/plugins/reporting/server/export\_types/csv\_searchsource\_immediate/execute\_job.js:47:20)\n at /usr/share/kibana/x-pack/plugins/reporting/server/routes/generate/csv\_searchsource\_immediate.js:84:11\n at Router.handle (/usr/share/kibana/src/core/server/http/router/router.js:163:30)\n at handler (/usr/share/kibana/src/core/server/http/router/router.js:124:50)\n at exports.Manager.execute (/usr/share/kibana/node\_modules/@hapi/hapi/lib/toolkit.js:60:28)\n at Object.internals.handler (/usr/share/kibana/node\_modules/@hapi/hapi/lib/handler.js:46:20)\n at exports.execute (/usr/share/kibana/node\_modules/@hapi/hapi/lib/handler.js:31:20)\n at Request.\_lifecycle (/usr/share/kibana/node\_modules/@hapi/hapi/lib/request.js:371:32)\n at Request.\_execute (/usr/share/kibana/node\_modules/@hapi/hapi/lib/request.js:281:9)"}

The error below occurred one time.  
{"type":"log","@timestamp":"2021-12-17T08:51:42-03:00","tags":["warning","plugins","reporting","csv\_searchsource\_immediate","csv\_searchsource\_immediate","execute-job"],"pid":2049,"message":"CSV may contain formulas whose values have been escaped"}

I'm looking for a way to share the data.

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [December 17, 2021, 3:03pm UTC](https://discuss.elastic.co/t/export-to-csv-shows-blank-fields/292218/4 "2021-12-17T15:03:42Z")

</div>

Thank you for the log messages. It confirms that this open bug is the issue: [[Reporting] CSV generation logs show a thrown TypeError · Issue #120278 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/120278)

> [@Richard\_Schroeder](#):
>
> I'm looking for a way to share the data.

Thank you very much. We just need a minimal dataset that will reproduce the problem.

---

<div class="post-metadata">

**Author:** ![Richard\_Schroeder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richard_schroeder/32/86153_2.png) [@Richard\_Schroeder](https://discuss.elastic.co/u/Richard_Schroeder)\
**Post date:** [December 17, 2021, 4:17pm UTC](https://discuss.elastic.co/t/export-to-csv-shows-blank-fields/292218/5 "2021-12-17T16:17:02Z")

</div>

Thanks for the feedback!

The problem seems to be related to data conversion, I am preparing a small dataset to share, and what I realized is that if the data is imported with the field in which the problem occurs with the data type text (originally the field is mapped with the date type), then the problem in exporting the data does not occur.

I keep working to share the data.

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [December 17, 2021, 5:35pm UTC](https://discuss.elastic.co/t/export-to-csv-shows-blank-fields/292218/6 "2021-12-17T17:35:52Z")

</div>

Hi, I want to make sure I understand.

1. A field exists in 10% of the records.
2. The export of the data has no filters
3. When it is mapped as `date`, then the bug occurs 🐛
4. When the field is mapped as `text` the bug does not occur 👌

---

<div class="post-metadata">

**Author:** ![Richard\_Schroeder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richard_schroeder/32/86153_2.png) [@Richard\_Schroeder](https://discuss.elastic.co/u/Richard_Schroeder)\
**Post date:** [December 20, 2021, 1:15pm UTC](https://discuss.elastic.co/t/export-to-csv-shows-blank-fields/292218/7 "2021-12-20T13:15:22Z")

</div>

Exactly, your description is correct.  
I'm working to be able to share the data, it involves sensitive customer information, we're obfuscating the data.

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [December 20, 2021, 8:38pm UTC](https://discuss.elastic.co/t/export-to-csv-shows-blank-fields/292218/8 "2021-12-20T20:38:44Z")

</div>

Hi @Richard_Schroeder I was able to reproduce the TypeError using data with a null timestamp field for the first 500 documents, and the latter documents have the timestamp field existing in 10% of the data.

---

<div class="post-metadata">

**Author:** ![Richard\_Schroeder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richard_schroeder/32/86153_2.png) [@Richard\_Schroeder](https://discuss.elastic.co/u/Richard_Schroeder)\
**Post date:** [December 21, 2021, 12:39pm UTC](https://discuss.elastic.co/t/export-to-csv-shows-blank-fields/292218/9 "2021-12-21T12:39:27Z")

</div>

Hi @tsullivan this is good news. I saw that you updated the issue, do you still need the database to reproduce the problem?

Thank you very much for your commitment to solving the problem.

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [December 22, 2021, 3:48pm UTC](https://discuss.elastic.co/t/export-to-csv-shows-blank-fields/292218/10 "2021-12-22T15:48:04Z")

</div>

Hi Richard, I do not need you to supply any data about this issue. At this point, the fix is ready for the team to review. Thank you for your patience with this bug!

---

<div class="post-metadata">

**Author:** ![Richard\_Schroeder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richard_schroeder/32/86153_2.png) [@Richard\_Schroeder](https://discuss.elastic.co/u/Richard_Schroeder)\
**Post date:** [January 4, 2022, 12:00pm UTC](https://discuss.elastic.co/t/export-to-csv-shows-blank-fields/292218/11 "2022-01-04T12:00:16Z")

</div>

Hi tsullivan, are there any expectations for the release date of this fix?

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [January 4, 2022, 6:06pm UTC](https://discuss.elastic.co/t/export-to-csv-shows-blank-fields/292218/12 "2022-01-04T18:06:56Z")

</div>

It will be available when 8.1 is released. There is not a firm date on when that release will be.

---

<div class="post-metadata">

**Author:** ![Richard\_Schroeder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richard_schroeder/32/86153_2.png) [@Richard\_Schroeder](https://discuss.elastic.co/u/Richard_Schroeder)\
**Post date:** [January 6, 2022, 12:11pm UTC](https://discuss.elastic.co/t/export-to-csv-shows-blank-fields/292218/13 "2022-01-06T12:11:59Z")

</div>

Is there any possibility to release the fix in 7.16.3 or 7.17?  
Because I believe these versions will be released before 8.1.  
Thanks for the feedback.

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [January 6, 2022, 5:03pm UTC](https://discuss.elastic.co/t/export-to-csv-shows-blank-fields/292218/14 "2022-01-06T17:03:46Z")

</div>

> [@Richard\_Schroeder](#):
>
> Is there any possibility to release the fix in 7.16.3 or 7.17?

Hi Richard, this is a reasonable request and the fix is low-risk to backport to these versions. I believe the changes for 7.16.3 and 7.17 may already be locked in and undergoing testing. I am backporting the fix to the 8.0, 7.16 and 7.17 branches.

The 7.16.3 branch may already be locked for release - if it didn't get in early enough for 7.16.3, it will be in one of the later releases.

---

<div class="post-metadata">

**Author:** ![Richard\_Schroeder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richard_schroeder/32/86153_2.png) [@Richard\_Schroeder](https://discuss.elastic.co/u/Richard_Schroeder)\
**Post date:** [January 7, 2022, 11:51am UTC](https://discuss.elastic.co/t/export-to-csv-shows-blank-fields/292218/15 "2022-01-07T11:51:44Z")

</div>

Thank you tsullivan!

I have just one more request, when you finished the backport, let me know which version you did the backport, so I can follow along and know when it is released.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 4, 2022, 11:52am UTC](https://discuss.elastic.co/t/export-to-csv-shows-blank-fields/292218/16 "2022-02-04T11:52:06Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [February 9, 2022, 11:36pm UTC](https://discuss.elastic.co/t/export-to-csv-shows-blank-fields/292218/17 "2022-02-09T23:36:52Z")

</div>

Hi @Richard_Schroeder , the fix is available in 7.17.0, which is out now.
