Google-sheets – How to automate find and replace link in Google Sheets from form photo submission

formulasgoogle sheetsgoogle-apps-script

Trying to automate find and replace function on form submission within sheets.
Principal/Teacher submits a photo through a Google Form and I want to change from the file link to a search to link within the Google Sheet. Currently have to manually do this and would like to automate the process.

Here are the find and replace codes currently using find

https://drive.google.com/open?id=

and replacing with

https://drive.google.com/uc?export=view&id=

Best Answer

You would need to use a formula with the SUBSTITUTE function

=SUBSTITUTE(D8,"https://drive.google.com/open?id=", 
               "https://drive.google.com/uc?export=view&id=")

enter image description here