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 8765971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:25:44+00:00 2026-06-13T16:25:44+00:00

I have a form that I would like my employees to complete each day.

  • 0

I have a form that I would like my employees to complete each day. To that end, I added a script to the spreadsheet to auto-email a link to the form to everyone that the spreadsheet is shared with. There is also a weekly email of their responses sent back. I have stored all the shared users in a ScriptDb. What I would like to do is write a UiApp that will allow user preferences to be set so the daily/weekly emails can be disabled. I would also like to be able to add new users here that do not have the sheet shared with them (for those who just have the link). My entire company uses google so I don’t have to worry about someone not being signed in or having access.

At first I tried creating a simple UiApp form that just showed existing shared users with check boxes for the email preferences. My doPost was never called, I’m still not sure why. However, what I would really like would be a screen that looks just like the Share Settings screen but instead of Edit/View access, I would have the user preferences. Adding users to my custom version of the screen would not add them as collaborators or viewers.

Any ideas on how to re-create the Share screen using UiApp?

If that is not possible, then what am I doing wrong in my current simple preference screen?

function editUserPreferences() {
var ss = SpreadsheetApp.getActiveSpreadsheet();

updateUserPreferences();
var db = ScriptDb.getMyDb();
var results = db.query({});
var saveUserRow = [];

//define form
var app = UiApp.createApplication().setTitle("Edit User's Email Preferences");
app.setHeight(550).setWidth(800);
var form = app.createFormPanel().setId('frm');
var formContent = app.createGrid(results.getSize()+5,3);
formContent.setWidget(0, 0, app.createLabel('Email Address'));
formContent.setWidget(0, 1, app.createLabel('Receive Daily'));
formContent.setWidget(0, 2, app.createLabel('Receive Weekly'));
formContent.setWidget(1, 1, app.createLabel('Reminder'));
formContent.setWidget(1, 2, app.createLabel('Entries'));

var row = 2;  
while (results.hasNext()) {
var obj = results.next();
row = row+1;
formContent.setWidget(row, 0, app.createTextBox().setValue(obj.email).setReadOnly(true));
formContent.setWidget(row, 1, app.createCheckBox().setValue(obj.preferences.dailyEmail).setName('daily' + row));
formContent.setWidget(row, 2, app.createCheckBox().setValue(obj.preferences.weeklyEmail).setName('weekly' + row));
obj.row = row;
saveUserRow.push(obj);
}

// file changes
var results = db.saveBatch(saveUserRow, false);
if (db.allOk(results)) {
// everything went swimmingly, proceed
} 
else {  // partial or no success
for (var i = 0 ; i < results.length; i++) {
var item = results[i];
if ((typeof item.success) == 'function' && !item.success()) {
MailApp.sendEmail(Session.getActiveUser().getEmail(), "Error Updating Script Database", Logger.getLog());
}
}
}

row = row + 2;
formContent.setWidget(row, 1, app.createSubmitButton('Submit'));

form.add(formContent);
app.add(form);
ss.show(app);
}

function doPost(e) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var app = UiApp.getActiveApplication();
var db = ScriptDb.getMyDb();
var results = db.query({});
var editedUserData = [];

Logger.log("in doPost");
while (results.hasNext()) {
var obj = results.next();
var dailyParam = "daily" + obj.row;
var weeklyParam = "weekly" + obj.row;
Logger.log("test");
Logger.log(obj.email);
Logger.log(dailyParam);
Logger.log(weeklyParam);
obj.preferences.dailyEmail = e.parameter.dailyParam;
obj.preferences.weeklyEmail = e.parameter.weeklyParam;
Logger.log(Utilities.jsonStringify(obj));
editedUserData.push(obj);
}

app.close();
return app;
}

Nothing is logged from doPost and the last entries in the execution transaction are:

FormPanel.getId()
FormPanel.getId()
UiInstance.isStandardsMode()
  • 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-13T16:25:45+00:00Added an answer on June 13, 2026 at 4:25 pm

    Kmt – there is no way to control the Share screen programmatically. You’ll have to rebuild it like you are doing here.

    Regarding your issue with doPost – I see it working. I think there is a logger issue where the logs generated in doPost (asynchronously dont work). Try creating a file or appending to a spreadsheet in doPost and that will work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form that has label values that I would like to pass
I would like to have a form that can submit to two different action
I have a form that edits an instance of my model. I would like
I have an In-house windows form app that I would like to use Spell
I have a form with two selectfields. I would like that when something is
I have an API in the form of a JAR that I would like
I have 5 links that are on the same form but I would like
I have a form that I would like to endow with wonderful Ajax-submission goodness
I have a borderless form that I would like to change the location of
I have a XAML form that I would like two independent features threaded out

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.