I want to send a csv every day in an email. I have the csv data as a string field from a private API and I cannot make the API public.
Gmail takes in a file object.
So, how does one take that string into a file object and give it a name which gmail can attach?
Page 1 / 1
Hi @TylerFromReceive
Can you provide more details and a specific example to better clarify for us?
Screenshots are helpful for context.
Hi, so i have zap which is:
every day at 2pm UTC
grab a list of users
do a for loop for each user:
run custom code which downloads a csv file from https://example.com/csv?k1=v1&k2=v2 and puts it as an output variable since it’s a string. it uses headers for authorization which is why I can’t put the public URL in the gmail section.
Send an email via gmail to the user with the csv as an attachment
My problem is that gmail requires a “file object” (or a public URL which I don’t have). I cannot figure out how to turn my csv text into a “file object” that gmail can attach. I don’t want to upload the csv publicly and then attach as that’s messy.
What i’d like is a very simple utility which given a filename and file content, both as strings, creates a file object for usage in later parts of zapier
@TylerFromReceive
You can try using a Code step to create a CSV file.
Another option would be to try this Zap action: GDrive - Create File from Text
> You can try using a Code step to create a CSV file.
I asked the chatbot AI how to do it, and it did what I did which was output it as text. We also both tried using stringIO, but got back an error “We were unable to place a file in a text field or possibly the otherway around.” It did not help me output a value that’s type is “file object”
This is the only instance I can find of the phrase “file object” anywhere in the docs. Is there example code on how to make a file object?
@TylerFromReceive
You may be better served by trying to open a ticket with Zapier Support to ask about possible guidance for the solution you seek: https://zapier.com/app/get-help
I have an open ticket, they haven’t gotten back to me yet