MGD
July 8, 2022, 6:40am
1
Describe the issue/error/question
Hello, im trying to send a .CSV content to my webhook, i cant send in json format, i need to send only in .csv format. The same return.
I dont know what but cant get all registers, i cant get only the first.
So i dont know what is possible to do to solve this…
What is the error message (if any)?
No error, just a difficult.
The workflow
Share the output returned by the last node
17,1,HORT CHUCHU EMB KG , ,59,0,KG ,KG ,59
Information on your n8n setup
**n8n version:0.165.1
**Database you’re using (default: SQLite):**SQLite
Running n8n with the execution process [own(default), main]:
Running n8n via [Docker, npm, n8n.cloud, desktop app]: Desktop
Hey @MGD , welcome to the community!
Check out this example from @dickhoning :
just in case somebody is interested, this is the final code for a simple workflow that I use as a micro service to convert a simple (/flat) JSON array to an Excel file …
[Screenshot 2022-02-04 at 16.22.26]
It returns an Excel file but should work just as well with CSV.
MGD
July 8, 2022, 6:43am
3
Hello MutedJam, its almost like that.
I need to send the same content of CSV (same data). Its not just saving in a file, need to send back to webhook.
That’s what the example will do. You open a URL and get a full file in response.
MGD
July 8, 2022, 6:45am
5
In this example its send in attached file, i need to send a full response (.csv) in text mode.
Well i will test again with your example. Lets see what i get.
So you don’t actually want a CSV file but just a response that looks like a CSV file?
You could try this approach using the Move Binary Data node:
This returns first generates the CSV and then reads it into a single item which is then returned like so:
MGD
July 8, 2022, 6:54am
7
This is the problem, i cant respond in JSON… need to be the same format as .csv, comma values…
Yeah, check out my latest example workflow. It returns text only, no JSON
1 Like
Awesome, glad to hear this helps! Thx for confirming
MGD
July 8, 2022, 7:04am
11
Very nice… Now i need to know why data is truncated… I have 5800 rows… i can only see 1800
So this might be a different problem. Do you see all 5,800 rows in n8n after reading your file?
MGD
July 8, 2022, 7:08am
14
Im trying but all workflow is in binary… Can we put a tempory node to see in TABLE format ?
I’d think your Spreadsheet File node would do that - it ready your binary data and returns the content in a table format:
MGD
July 8, 2022, 7:16am
16
Yes, its all there…
Maybe the problem is with the “comma” structure of the original .csv file…
The response has all values… But my destiny system ( reading ) cannot read all values… I think its not related with n8n…
Glad to hear you were able to confirm it, sorry to hear about the problem though
The spreadsheet node itself doesn’t have a lot of options for building the CSV unfortunately, so you might want to raise a feature request if you’re missing something specific (like wrapping values in specific quotes, or using a different separator than the comma).
1 Like
MGD
July 8, 2022, 7:46am
19
I think i found…
I have 3 fiels that has " because they are price values, example:
field1, field2,“3,99”,“4,50”,“3,30”, field6
I think the output is truncated something…
Another problem is with latin characters in the output: ç ã é
picolé are showing: PICOLÃ
My Enviroment: n8n Windows Desktop
Well , i used the https://csvlint.io/ website to validate and standarized the .csv file.
The problem is with n8n. n8n is removing the " delimiter.
BramKn
July 8, 2022, 8:27am
20
Hi @MGD
I messed around with these kinds of CSV a lot in the past.
there are some options in the spreadsheet node you can try:
Setting them to true will most likely mes sup the format and ease of use but it does give you the chance to create a workarround.
2 Likes