How to allow users to Upload local file, Edit in sheets, and Write back to local file - google-sheets

I'm investigating if it's possible for a user to: Pick a file on disk, automatically upload it to Google Sheets, do some edits, and write the changes back to the file.
I basically want to use Google Sheets as the Editor of the local file.
Has anyone tried something like this, or can confirm if it's a feasible idea?
My rough idea:
Install a script or program, that a user (on our team) can execute with the appropriate file they pick.
Typically they right-click a file and pick "Open with MyGoogleSheetsCreate".
The ToSheets-script does the following:
Generates a temporary Spreadsheet on the user's Google Drive (or possibly a Team Drive/Folder for temp files)
Reads the custom data in the local file and enters it into the Spreadsheet.
Opens a Browser window with the generated spreadsheet.
The user makes some changes to the spreadsheet.
The user exports the changes back to the file.
User initiates this how? Some ideas:
Perferably: I build a button or menu option to "Export back to Local Disk". This would only be viable if we could explicitly say where to save this custom file, i.e. where it came from.
Optionally: They right-click the original file and pick "Open with MyGoogleSheetsRetrieve". The importer would need to know the address of the Google Sheet the local file was last exported to.
FromSheets-Script converts the Spreadsheet into our custom data format and overwrites the old file.
Bonus: The temporary Google Sheet would be automatically moved to the Bin within a couple of days (without user interaction).
I think I've got a good idea of how to convert our custom format to Sheets and vice versa. The steps I'm most unsure of are: 3.1 and 5.1

Related

AutoCAD CUIX: Swapping my LISP routine’s mapped drive URL link in my Macro with the Google Share Drive web based link of the same file

My LISP routines are on the Google Share Drive at my work. I have buttons in my custom ribbon that calls my routines using a mapped drive letter URL link.
URL Link example in my custom Macro:
Goal:
Trying to share this with the other CAD users in the office.
Problem:
Various CAD Users have different mapped drive letters (Ex: H:\ or S:\ instead of G:).
Trying to avoid going around and manually changing the drive letter to match their mapping every time I updated the CUIX file (since path would be overwritten).
Would like to use the universal Google Share Drive web based link (by selecting the file and choose "get link" in Google Drive and copy the link).
The Swap:
Current URL Mapping in my Macro example (if image above not showing):
^C^C(load "G:\shardrive\CAD_Department\CAD_menu\LISP\My_routine.lsp");My_routine;
Example of swapping with the Google Share Drive link (not working):
^C^C(load "https://drive.google.com/file/d/0BlU92IihdhhcnRlcl9mWxl/view?usp=sharing&resourcekey=0-0VxGZXU_D8YjtjgjzQZnQ");My_routine;
Another method I tried
^C^C(command-s "_browser" "https://drive.google.com/file/d/0BlU92IihdhhcnRlcl9mWxl/view?usp=sharing&resourcekey=0-0VxGZXU_D8YjtjgjzQZnQ/");My_routine;
Anyone know the proper syntax for the macro?
Thanks in advance!
Sounds like a more configurable approach is needed, where the users can map the drives with whatever path they want (G:, S:\ or whatever). But they can still use the tools that are inside said drive.
To do this there are three things that would help:
1.) start using AutoCAD profiles. It's possible write a setup script to create the profile for the user. This profile would contain a support file path entry for the location of your LISP code. The path would vary depending on where the user has google drive mapped to.
2.) load all LISP from the profile when AutoCAD starts up, this can be done with the acaddoc.lsp file.
3.) remove all hard-coded load statements from the CUI buttons
For the issue I mentioned in my comment above about opening a folder through the CUIX macro only (and not through a LISP routine), I found this possible solution:
^C^C(startapp "explorer" (vl-string-translate "/" (chr 92) "C:/TEMP"));
Credit to Paul_Gander and his comments located here:
https://forums.autodesk.com/t5/autocad-forum/open-a-folder-with-a-button/td-p/3010928
More testing needed but so far so good...
Thank you Paul!

Download embeded google sheets

as I'm not a web developer by any means, this is me just asking a question for that I have not found a solution for.
I have a google sheet with multiple pages/sheets within it. the file is embeded in an iframe inside a webpage and I pulled the url and can open it directly using the url. the following link is just an example as I can't share the actual link since I am not allowed to:
https://docs.google.com/spreadsheets/d/e/{key}/pubhtml?widget=true&headers=false
I have tried this:
https://spreadsheets.google.com/feeds/download/spreadsheets/Export?key={key}
and is not working I get an error:
Sorry, unable to open the file at present.
Please check the address and try again.
the file is not meant for anyone to download nor share. Furthremore, since it is continuosely manually updated by author and I need to keep track of updates, taking screenshots is not efficient since the file is too big.
is there any way I can download the actual sheet to my device (so I can compare file updates over the long run)
Thank you.
I believe your goal as follows.
You want to download a Google Spreadsheet.
You are the owner of Google Spreadsheet.
The Spreadsheet is published as the Web publish. So the URL of Spreadsheet is https://docs.google.com/spreadsheets/d/e/2PACX-1vTl9bcwMSjoxYj406evzJefFodkVEUlV2KIq34Y5V8BFWJygAFrPSA7L5d89TASDUjkPG4b2SfN2rpe/pubhtml?widget=true&headers=false.
Issue and workaround:
Unfortunately, the Google Spreadsheet cannot be directly downloaded as the Google Spreadsheet. It seems that this is the current specification. In this case, it is required to export the Google Spreadsheet as other mimeType. For example, it's XLSX format, PDF format and CSV format. But the URL of https://docs.google.com/spreadsheets/d/e/2PACX-1vTl9bcwMSjoxYj406evzJefFodkVEUlV2KIq34Y5V8BFWJygAFrPSA7L5d89TASDUjkPG4b2SfN2rpe/pubhtml?widget=true&headers=false cannot directly export. So, in this answer, as a workaround, I would like to propose to use the URL for exporting Google Spreadsheet as other mimeType.
When your URL is used, the URL for exporting is as follows.
Modified url:
https://docs.google.com/spreadsheets/d/e/2PACX-1vTl9bcwMSjoxYj406evzJefFodkVEUlV2KIq34Y5V8BFWJygAFrPSA7L5d89TASDUjkPG4b2SfN2rpe/pub?output=xlsx
In this case, when you access to above URL using browser, your Spreadsheet can be exported as a XLSX file.
When output=xlsx is modified to output=pdf and output=csv, you can export as a PDF file and a CSV file, respectively.
When you want to export the specific sheetm please use the sheet ID like gid=0. The URL is as follows.
https://docs.google.com/spreadsheets/d/e/2PACX-1vTl9bcwMSjoxYj406evzJefFodkVEUlV2KIq34Y5V8BFWJygAFrPSA7L5d89TASDUjkPG4b2SfN2rpe/pub?output=xlsx&gid=0
Note:
When you want to make users downloading the Spreadsheet, you can add the tag a as follows.
Download

Share multiple files via UIActivityViewController to Dropbox

My application works with HealthKit data in order to create some reports from the user's workout data and exports them to one or more files (mainly CSV and sometimes GPX files). To allow the user to access these files I present the standard UIActivityViewController passing as items an array of file as [URL] and no application activities (this is the relevant line in the code where files is the array of URLs).
It all works without issues, but today one of my users reported that when multiple files are exported and Dropbox is selected as the target for sharing the files, only the first one is saved and the others are ignored. Is there something I can do about it or is an issue that must be solved by Dropbox? To my understanding it should be the latter, but I can be missing something.
If they are relevant, here are two screenshot of the sharing screen under iOS 13: in the first only one CSV file is being shared and there's a Save to Dropbox option, in the second I'm sharing 2 CSV and 1 GPX files and that option is no longer there. In the second case there's still Copy to Dropbox (hidden) and it leads to only one file being saved, if I use Save to Files, all 3 files are correctly saved.
Marco,
You are right, this is a Dropbox issue, not an issue with your apps export. It looks like the Dropbox app, by default, only accepts one file when received from the export action. Here is the workaround. The native iOS Files app will accept multiple export files and it is possible to add the Dropbox folders to the Files app, effectively allowing the multiple files to be uploaded to Dropbox.
Adding Dropbox to Files app:
Open Files app, on the app main screen, click the three dots in the upper right corner, and select edit.
This will show a ghosted Dropbox file with a toggle switch next to it, tap to add Dropbox to the list of available files.
Exporting the Multiple Files to Dropbox:
Once steps 1 and 2 are complete, go to the desired export app, and select the file you want to export.
In the list of export options, select the iOS Files app (not Dropbox), and then select the Dropbox file within the Files app. Then you can select the Dropbox sub-folder you want the multiple export files to be placed in.
That accomplishes the desired goal in the same number of steps as exporting to DropBox.

How can I send google sheets with the script

I have google sheets with a script included (the script is a simple function that I made to calculate something in the sheet). I want to send it to my colleague.
When I try to download it and send it or open it locally I get error msg "Unknow function".
How can I download it and send it to my colleague with the script included?
You have a couple of alternatives.
Solution 1
Create a new "demo" sheet, include the script, change permissions to Anyone with the link can edit (or view), send them the link and ask them to make a copy of it.
You could also send them just the link to it with copy instead of edit in the end of it (https://docs.google.com/spreadsheets/d/xxxxxxxxx/copy)
Solution 2
Copy the script to a simple text file (.txt) and send them the file. They can then copy/paste it using the Script editor on their sheet.
NOTE: Do not use any Word processor (like Office Word, Google Docs, etc) because they leave residue of entities that could render the code unusable.

Send Excel files to Office for editing and read changes

Right now I have an Excel file locally in my iOS application and the file is downloaded from our own servers.
I want to be able to edit the Excel file somehow and I can't seem to get my head around how to do it with the Excel app.
I'm aware that you can't edit local files in another app like that, so I tried with links to files on my OneDrive account. I just can't seem to get the url right.
It seems like I need a direct link to the file, but all I get is a guest access link, when I make the file shareable.
Have you tried the Google Sheets app? Might do the trick.

Resources