Work Flow Batch Process Result is saved as Json format in CSV, need to be in well read format #5915

Closed
opened 2026-02-21 18:13:12 -05:00 by yindo · 2 comments
Owner

Originally created by @toptalentsgpt on GitHub (Oct 4, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.8.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

c0a228bf-1e4f-4bc0-b946-db8c74bb7d79

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @toptalentsgpt on GitHub (Oct 4, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.8.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![c0a228bf-1e4f-4bc0-b946-db8c74bb7d79](https://github.com/user-attachments/assets/d79468cc-2e1d-40a7-a26f-02438945e178) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🌊 feat:workflow label 2026-02-21 18:13:12 -05:00
yindo closed this issue 2026-02-21 18:13:12 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Oct 4, 2024):

Hello @toptalentsgpt! I'm here to help you with any bugs, questions, or contributions you may have. Let's work together to tackle this issue.

The issue you're encountering seems to be related to the formatting of JSON data when it's saved as a CSV file in Dify's batch processing workflow. The CSV output might not be in a well-readable format.

In Dify, the CSVDownload component is responsible for formatting JSON data when saving it as a CSV file. This component uses the getTemplate function to determine the CSV template based on the document form and locale, and the CSVDownloader component from react-papaparse is used to download the data in CSV format [1].

If the CSV output is not as expected, you might want to check the templates defined in the codebase to ensure they match your requirements. The templates specify the intended format for CSV outputs, such as the column names and structure for different types of documents (e.g., QA documents or text documents in different languages) [1][2].

If further customization is needed, you may need to adjust these templates or the logic in the CSVDownload component to better suit your needs.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Oct 4, 2024): <!-- Greeting --> Hello @toptalentsgpt! I'm here to help you with any bugs, questions, or contributions you may have. Let's work together to tackle this issue. <!-- Answer --> The issue you're encountering seems to be related to the formatting of JSON data when it's saved as a CSV file in Dify's batch processing workflow. The CSV output might not be in a well-readable format. In Dify, the `CSVDownload` component is responsible for formatting JSON data when saving it as a CSV file. This component uses the `getTemplate` function to determine the CSV template based on the document form and locale, and the `CSVDownloader` component from `react-papaparse` is used to download the data in CSV format <sup>[[1]](https://github.com/langgenius/dify/blob/main/web/app/components/datasets/documents/detail/batch-modal/csv-downloader.tsx)</sup>. If the CSV output is not as expected, you might want to check the templates defined in the codebase to ensure they match your requirements. The templates specify the intended format for CSV outputs, such as the column names and structure for different types of documents (e.g., QA documents or text documents in different languages) <sup>[[1]](https://github.com/langgenius/dify/blob/main/web/app/components/datasets/documents/detail/batch-modal/csv-downloader.tsx)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/web/app/components/share/text-generation/run-batch/csv-download/index.tsx)</sup>. If further customization is needed, you may need to adjust these templates or the logic in the `CSVDownload` component to better suit your needs. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Oct 4, 2024):

You can use any script language to process this data if you want, we do not have a plan for this because the result can be complicated and in any format.

Consider you have something like below:

query,生成结果
1,"{""output"":""# Hello Video Example\n\n## Video\n\n<video  controls>\n  <source src=\""http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4\"" type=\""video/mp4\"">\n  Your browser does not support the video tag.\n</video>\n\n## Audio\n\n<audio controls>\n  <source src=\""http://codeskulptor-demos.commondatastorage.googleapis.com/pang/arrow.mp3\"" type=\""audio/mpeg\"">\n  Your browser does not support the audio tag.\n</audio>\n\n## Image\n\n![1](https://private-user-images.githubusercontent.com/10139727/371105575-c3dd3b86-ef27-40c8-b9c5-10b1ec7914d7.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjczNDk3MDgsIm5iZiI6MTcyNzM0OTQwOCwicGF0aCI6Ii8xMDEzOTcyNy8zNzExMDU1NzUtYzNkZDNiODYtZWYyNy00MGM4LWI5YzUtMTBiMWVjNzkxNGQ3LmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTI2VDExMTY0OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVkMWM4YjczNWVjYzU2MzIwYmI3NTZkZGM1ODE0NGM1YzQ2YTg5MjEyYWZlZTRhNWU2ZTcxNmM5ODFkNTBlNDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.fiqRBv9iRXfwCa6KyZcgdZZFDjA0-93OkcPBO1delhA)\n\n![2](https://private-user-images.githubusercontent.com/10139727/371105575-c3dd3b86-ef27-40c8-b9c5-10b1ec7914d7.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjczNDk3MDgsIm5iZiI6MTcyNzM0OTQwOCwicGF0aCI6Ii8xMDEzOTcyNy8zNzExMDU1NzUtYzNkZDNiODYtZWYyNy00MGM4LWI5YzUtMTBiMWVjNzkxNGQ3LmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTI2VDExMTY0OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVkMWM4YjczNWVjYzU2MzIwYmI3NTZkZGM1ODE0NGM1YzQ2YTg5MjEyYWZlZTRhNWU2ZTcxNmM5ODFkNTBlNDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.fiqRBv9iRXfwCa6KyZcgdZZFDjA0-93OkcPBO1delhA)""}"

It contains html result,some audio tag and video tag, it can not be converted into readable language.

@crazywoola commented on GitHub (Oct 4, 2024): You can use any script language to process this data if you want, we do not have a plan for this because the result can be complicated and in any format. Consider you have something like below: ``` query,生成结果 1,"{""output"":""# Hello Video Example\n\n## Video\n\n<video controls>\n <source src=\""http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4\"" type=\""video/mp4\"">\n Your browser does not support the video tag.\n</video>\n\n## Audio\n\n<audio controls>\n <source src=\""http://codeskulptor-demos.commondatastorage.googleapis.com/pang/arrow.mp3\"" type=\""audio/mpeg\"">\n Your browser does not support the audio tag.\n</audio>\n\n## Image\n\n![1](https://private-user-images.githubusercontent.com/10139727/371105575-c3dd3b86-ef27-40c8-b9c5-10b1ec7914d7.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJ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YXRlPTIwMjQwOTI2VDExMTY0OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVkMWM4YjczNWVjYzU2MzIwYmI3NTZkZGM1ODE0NGM1YzQ2YTg5MjEyYWZlZTRhNWU2ZTcxNmM5ODFkNTBlNDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.fiqRBv9iRXfwCa6KyZcgdZZFDjA0-93OkcPBO1delhA)""}" ``` It contains html result,some audio tag and video tag, it can not be converted into readable language.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#5915