Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8190069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:29:49+00:00 2026-06-07T03:29:49+00:00

I have a program that will get data from a fusion table, put it

  • 0

I have a program that will get data from a fusion table, put it in a google doc(using a template I made), make it a pdf and then display a link to it(to the pdf). My problem is that it works fine for my account but if anyone else tries to click on it they keep getting the “404 Not Found” error. My guess is that the error shows up because I am the only one allowed to view the file. My question is: Is there a way to programmatically share the file with everyone in the organization or is there another way to do it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T03:29:51+00:00Added an answer on June 7, 2026 at 3:29 am

    You can do it using DocsList.addViewers(viewersEmails[])

    here is an example that takes a list of viewers as parameter, add them as viewers and sends an email with the link :

    function addviewers(viewers) { // pass emails as a string in CSV
      var viewerssArray = viewers.replace(/, /g,",").split(",");// the 'replace' is there to remove any spaces that could be in the string
      Logger.log(viewersArray.length+'  :  '+viewersArray);
      var file = DocsList.getFileById('your doc ID').addViewers(viewersArray);
      var docurl=file.getUrl();    
          for (nn=0;nn<viewersArray.length;++nn){
            MailApp.sendEmail(viewersArray[nn], 'your document', docurl);
              }
    }
    

    I first used ‘editor’ as variable name, now changed to ‘viewers’ to avoid confusion.

    If you really need to include everybody in your domain to get access I guess the best solution would be to create a group with all users to simplify the process.

    EDIT : there is maybe a simpler solution that is to move the file in a shared folder : all items in a folder have the same sharing parameters as the folder itself.

    example :

    function sharebyFolder(){
        var file = DocsList.getFileById('docId');
        var folder = DocsList.getFolderById('shared folder Id');
        file.addToFolder(folder)
          }    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to build a program that will allow me to track from a
I have a program that will let me manage users on our terminal server
I have a java program that will work with a variety of Java Beans.
For a school assignment I have to create a C++ program that will create
In my program, I've got a bunch of classes that will only ever have
I have a program that receives real time data on 1000 topics. It receives
I have this program that is reading the test string from a textbox and
I am making a program that reads and stores data from Windows EventLog files
Lets say I have a server program that can accept connections from 10 (or
I'm currently creating an SSIS job that will pull picture data from a SQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.