11
votes

I am working on a internal app for my company in G Suite. I have a modal dialog that I am using in the spreadsheet app. I can not find a way to do this on Drive for mobile so I decided to Deploy as a web app. I have never used this feature in app script so I decided to set up a new project to mess around with before I applied it to my active project. I have two files in the project; Code.gs

    function doGet(e) {
  return HtmlService
    .createHtmlOutputFromFile('mainPage')
    .setSandboxMode(HtmlService.SandboxMode.IFRAME);
}

and mainPage.html

<!DOCTYPE html>

<head>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
</head>

<body>
    <!-- Reference: http://getbootstrap.com/javascript/#tabs -->
    <div role="tabpanel">
        <!-- Nav tabs -->
        <ul class="nav nav-tabs" role="tablist">
            <li role="presentation" class="active"><a role="tab" data-toggle="tab" aria-controls="home" href="#home">Home</a>
            </li>
            <li role="presentation"><a role="tab" data-toggle="tab" aria-controls="profile" href="#profile">Profile</a>
            </li>
            <li role="presentation"><a role="tab" data-toggle="tab" aria-controls="messages" href="#messages">Messages</a>
            </li>
            <li role="presentation"><a role="tab" data-toggle="tab" aria-controls="settings" href="#settings">Settings</a>
            </li>
        </ul>
        <!-- Tab panes -->
        <div class="tab-content">
            <div role="tabpanel" class="tab-pane active" id="home">Lorem ipsum dolor sit amet</div>
            <div role="tabpanel" class="tab-pane" id="profile">consectetur adipiscing elit,</div>
            <div role="tabpanel" class="tab-pane" id="messages">sed do eiusmod tempor incididun</div>
            <div role="tabpanel" class="tab-pane" id="settings">ut labore et dolore magna aliqua</div>
        </div>
    </div>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
</body>

</html>

I click "File>Manage Version" and create a version. Then "Publish>Deploy As WebApp" and get this Fetching Data

I have let this sit for more than 30 minutes with no change. I restarted my system and went through the steps again and still no change. Any suggestions on what is going on?

3
Have you tried clicking the button? or perhaps asking your admin if you have permision to deploy a webapp? - Cooper
Your missing an html tag just under !DOCTYPE. It deploys for me. - Cooper
Yeah I tried clicking the button, and I am the admin so that doesn't help. However, your comment got me thinking. The spreadsheet the GAS project is tied to was created on my personal account outside of the domain, so I logged into my personal account and tried and it worked. There are errors in my code somewhere but at least I am able to trouble shoot now. Thanks for the help. - J Cham
Same issue for me, it actually stopped mid deploy, and is stuck here, but the same script on the same sheet works if I share with another user - Hink

3 Answers

12
votes

Any suggestions on what is going on?

Fetching data...

To figure out what's going on, look at the underlying Google request via browser tools.

For Chrome:

  1. Open Developer tools
  2. Click the Network tab
  3. Re-run "Deploy as web app"
  4. Look for "sharingService" in the Network tab
  5. Click on it and review the underlying message

enter image description here

In my case, I was attempting to deploy from an account outside the organization:

Only users in the organization may deploy this script.

View the specifics for your case and decide what the next appropriate action is.

3
votes

To complete Ahmed answer:

you might not be part of the group or the owner of the script.

It's also true if you try to deploy a script from a file you have the right to edit without being the owner.

To change the owner: open the sheet with the owner account, go to share> advance> click on the arrow that triggers the dropdown> set as the owner.

1
votes

As Answered in this question, you might not be part of the group or the owner of the script.

Reference: https://github.com/dwyl/learn-to-send-email-via-google-script-html-no-server/issues/167#issuecomment-487575644