I have a Excel file that I would like to upload to Google Drive and have converted to a Google Sheet document. I don’t want the original Excel file in the drive at all.
The node seems to have its own client implementation instead of using Google’s libraries which makes it a bit too much of a hurdle to come up with a patch myself. I hope someone can implement it though
I would say it makes sense and it can be done… it is only software after all.
What tends to happen from what I have seen is if someone else mentions it someone will do a quick search and link to it then it will get a vote.
Looking at GoogleDrive.node.ts the change doesn’t look like it would be too bad, Would you like a free text field for it or a drop down where you can set the document type?
Hi @Jon, thanks for taking a look! It seems like a pretty easy fix.
I think a drop-down would make the most sense, I doubt they will add many more documents in the future. I also rather say “Google Docs” instead of their media type.
It is important that I also can change the value dynamically, as have one case where I receive many files and don’t know their file type up front. Is that also possible with a drop-down?
Like an auto option to try and work it out from the file extension I like the idea, I have a couple of tweaks that I want to make to the Xero node first but if no one else gets to it I may take a stab at it as it will be useful for some of the bits I want to do in the future as well with CSV files.
I think a drop-down would make the most sense, I doubt they will add many more documents in the future. I also rather say “Google Docs” instead of their media type.
You can load all the media types from the about resource. Or, you can copy them from file:list
It is important that I also can change the value dynamically, as have one case where I receive many files and don’t know their file type up front. Is that also possible with a drop-down?
You can set values dynamically using expressions.
It seems like a pretty easy fix.
Adding the new parameter and changing this line for this.getNodeParameter('mimeType', i) || mimeType, should do it.
Auto-option might be nice, but there are multiple possible mappings (some making more sense than others), so I’m not quite sure what would the best for the users in the end.
As @RicardoE105 noticed, the target media type list can at least be pre-populated from their API. If the known types are given friendly names (“Google Sheets” instead of “application/vnd.google-apps.spreadsheet”) it should be quite user friendly too.
I was thinking of friendly names in the drop down expecting people to know the actual mime type would be crazy.
I think the biggest issue will be automatically working out what the type should be. Google do list what each extension maps to but I think a couple can have different options so maybe an expression using a case / switch would be the best win.
That was the list I was looking at, So I was thinking cheat and have an “Auto” option which would just set the Office type document formats to the Google version, Leave Images and plain text / json as their normal option then if needed allow it to be set manually with an expression or something.
In case anyone is reading this and wants a working solution without waiting for a custom implementation in the Google Drive node, I wrote a post on how to do this with the HTTP Request node instead here: Upload And Convert Google Drive Spreadhseet - #2 by mark-monteiro