Thoughts on "Downloading >> Renaming photos (GoogleSpreadsheets) >> push renamed file to Google Drive" using Google Apps Script

Hi everyone,

I'm not pretty sure if posting this in ODK-Dev it's Ok or if it's better in
ODK Community, but here we go.

When i launch a project, as standard process i publish the results into
Google Spreadsheets. From there i can use the data for further analysis.
In some projects i need to take photos and i need to download and identify
that files (matching with the record where the picture come from).

Nowadays the process i do is basically manual and is as follows:

  1. identify the url in the spreadsheet
  2. add the "as_attachment=true" sufix to the url in order to download the
    file (copy-paste url into browser)
  3. once stored in hard drive i rename the file with
    "instanceID"+"file.jpg"...manually.
  4. then upload-it back to google drive.

Of course this way, is slow, messy and error-prone

I was thinking (lightly, if you want) on some other possibilities to
exploit data from Google Spreadsheets,
Recently (3 days ago) i discover Google Apps Script and start to
play-around with visualize data and i was wondering if it is possible to
"going beyond", and develop a server side method to work around my manual
method using this Language.

I'd like to brainstorm with you regarding this issue: perhaps we can
discover something useful for the entire community. :slight_smile:

Please, share your thoughts.
Thanks in advance.
Best regards

Neri Martinez.

Hi there,

You might be able to publish straight from Collect to Google Sheets
and your pictures would be in Google Photos and linked to your Sheet
automatically. See
https://www.google.com/earth/outreach/tutorials/odkcollect_drive.html
and http://nafundi.com/blog/posts/serverless-odk-deployments-with-google-apps
for tutorials.

Would something like that work for your use-case?

Yaw

ยทยทยท On Tue, Jan 17, 2017 at 6:08 AM, Neri David Martinez wrote: > Hi everyone, > > I'm not pretty sure if posting this in ODK-Dev it's Ok or if it's better in > ODK Community, but here we go. > > When i launch a project, as standard process i publish the results into > Google Spreadsheets. From there i can use the data for further analysis. > In some projects i need to take photos and i need to download and identify > that files (matching with the record where the picture come from). > > Nowadays the process i do is basically manual and is as follows: > 1) identify the url in the spreadsheet > 2) add the "as_attachment=true" sufix to the url in order to download the > file (copy-paste url into browser) > 3) once stored in hard drive i rename the file with > "instanceID"+"file.jpg"...manually. > 4) then upload-it back to google drive. > > Of course this way, is slow, messy and error-prone > > I was thinking (lightly, if you want) on some other possibilities to exploit > data from Google Spreadsheets, > Recently (3 days ago) i discover Google Apps Script and start to play-around > with visualize data and i was wondering if it is possible to "going beyond", > and develop a server side method to work around my manual method using this > Language. > > I'd like to brainstorm with you regarding this issue: perhaps we can > discover something useful for the entire community. :) > > Please, share your thoughts. > Thanks in advance. > Best regards > > Neri Martinez. > > -- > You received this message because you are subscribed to the Google Groups > "ODK Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to opendatakit-developers+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout.

Hello Yaw,
I tried to upload the images that i collected through to ODK to google photos but I am afraid that I might lose the link to access the photographs because googlesheet has the original link to image in in the google drive not to google photos.
Please help.
Thank you in advance.

Saneesh