Automatic table to create a list of specific inputs - google-drive-api

I'm trying to create a Google spreadsheet, with the start of the table a pop up window comes with a question of whether it is an Entry or Pickup.
After the decision, it should fulfill certain tasks after the election.
When choosing an Entry, a form should appear where you have to provide certain information. (The entered information should also be automatically inserted on the Google Table by the script.)
When selecting a Pickup, another form will appear that compares the information entered with the list of Google Sheets.
And upon successful approval, it should fullfill on the list in the Pickup section.
My question is whether it is possible with Google Drive to create such a script.

My question is whether it is possible with Google Drive to create such a script.
Yes.
You can create such a script with Google Sheets with Apps Script by using UI Modals. Create a HTML Form on these modals and when the submit button is pressed send the data to a custom function that places the data on your sheet.
You can have this executed when the file is opened thanks to Triggers.

Related

How to send Google form applicants to Org Charts

I need to automate the applicant and position ownership processes:
Forms> Acceptance> Plug them into an Org chart
Let me know if I can provide more use case info. I tried using Apps Script.
Thank you,
You can definitely use Google Apps Script to accomplish this.
First you need to create a Google Form the users will need to fill and get the data of that form in a spreadsheet. Once you have the spreadsheet you can start using Google Apps Script to create the users based on the data from the spreadsheet.
There is a code sample on how to create users in the Admin console using Google Apps Script here. I am assuming you will create your script so that it can add users based on the information introduced in the data from the spreadsheet, so you have the list of methods you can use here.
You would also need to add a trigger to your script so it starts running every time the spreadsheet gets edited, meaning that a user will get automatically created by the script every time someone fills the form and the responses get recorded in the spreadsheet.

Is there a way to fetch url for google sheets from a different spreadsheet using apps script?

I am trying to create a log for all the PDIR reports that are generated in our company. For this purpose, I have written an apps script code that brings forth a format from our master sheet when a product part no. is typed. After filling in the information it allows the user to press the submit button that transfers this PDIR to a PDIR database where all the PDIRs are being stored. Now, what I want to do is, add a feature to the submit button that automatically creates a log for the PDIR report. I have attached the format here for reference. I want to find a way to extract the URL of a particular sheet and add the link in the log next to the invoice, so my employees do not have to waste time finding different invoices and can just search for the invoice no. and have a link ready to take them to it.
Long story short, I want to find a way to get a URL of a sheet from a different spreadsheet using apps script.

Auto fill out google form based on Spreadsheet using Google Apps Script

I'm planning to create google form wherein it will be sent quarterly to employees. Once I get their responses, I want those responses to be auto filled out when they receive again that google form on the next following quarters.
Is there a way in Google form and Google Apps Script wherein answers are automatically filled out based on previous answers that's stored in Spreadsheet? It's like rollforward of answers.
Please let me know if it's feasible.
Google Forms have only one state. This is the current state.
You should avoid such complex dependent actions when you use this application.
You can create your own form. But this cannot be an answer on this forum.

How would I implement for loop using google script to edit a google form?

I am very new to scripting on Google form. In fact, I just recently fount out about it.
So what I'm trying to do is that I want to create a form that consists of duplicated pages in accordance to a number that is chosen by the user.
For instance, the form asks the user "How many people will be participating in this event?" If the user types in 5, the form will make 5 duplicates of a page, in which all of those pages will ask for the details of each participant.
So is there a way create duplicates of a page using a for loop?
First, you'll need to implement using installable form-submit trigger which runs when a user responds to a form.
For more information, check these two versions of the form-submit trigger:
Google Forms events
Google Sheets events
Then, when triggered, you may want to create new documents using the append methods in Class Body.
See this related SO posts for more insights and sample codes:
Duplicating a page of a document and replacing text on each page
Google app script copy document page

Update Google Forms field based on dynamic data from a Google Sheets spreadsheet

In a Google Form we have a pull down selection list.
The list of items may change from minute to minute. The master copy of the data is in a column in a google docs spreadsheet.
When a user accesses the form, we want them to see the latest copy of the pull down list as is current in the spreadsheet.
I don't see an obvious way to do this with triggers. onOpen, for example, only triggers for administrators of the form, not users. Is there a way I can keep this form up-to-date automatically?
This is my first time in google docs, but I'm very experienced in excel scripting.
The work flow needs to be a bit different than what you've described. Since there is no ability for Google Apps Script to interact with an end user accessing a Form, there's no way to react to that. However, you can react to changes in the spreadsheet, and update the form options in preparation for the next end user.
Depending on how the options get updated in the spreadsheet, you can use an installable trigger there, to react to an edit or a change.
If the form is associated with the spreadsheet containing the choices, you can get a handle on the form using Spreadsheet.getFormUrl(), then pass the URL to FormApp.openByUrl(). Otherwise you will need to provide the ID or URL explicitly to FormApp.openById() or .openByUrl(), respectively.
That spreadsheet trigger function can modify the available selections for the relevant question by using ListItem.setChoices() or ListItem.setChoiceValues().