我试图建立一个使用谷歌表单,工作表和应用程序脚本的工作流。举个简单的例子,让我们假设我正在为一家公司设置一个休假表。我有一份表格供员工填写他们的休假细节。在提交时,详细信息将填入表格中,并将电子邮件发送给某人以供批准。
这就是我被困的地方。批准请假申请的最佳方式是什么?我可以只是编辑工作表,一旦列已经从未经批准的更改为批准和电子邮件可以发送,但我希望避免编辑工作表在任何时候。
有更好的方法来处理这个工作流吗?
发布于 2019-07-23 16:53:42
假设有3个人需要批准请求。需要检查请求的审批人是审批人X、Y、Z。
您可以从通常由字母"e“指定的”事件对象“中获取用户以及它是否已被批准。
function doGet(e) {
var whatUserJustReviewed,isItApproved;
//Get the values passed in from "e" which is the event object
eventParam = e.parameter;
whatUserJustReviewed = eventParam.whichUser;
Logger.log(' whatUserJustReviewed : ' + whatUserJustReviewed )
isItApproved = eventParam. approved;
switch (whatUserJustReviewed) {
case "X"
if (isItApproved === 'true') {
// //Send an email to the next user which is Y
}
break;
case "Y"
if (isItApproved === 'true') {
// //Send an email to the next user which is Z
}
break;
case "Z"
if (isItApproved === 'true') {
//Send an email to all involved who need to know that it was approved.
}
break;
default:
console.error('There was an error getting user or status');
};
}https://stackoverflow.com/questions/52023578
复制相似问题