+ Reply to Thread
Results 1 to 11 of 11

Google Sheets: Requests Handling Automation

  1. #1
    Registered User
    Join Date
    09-26-2022
    Location
    London, England
    MS-Off Ver
    Microsoft Office 365 2021
    Posts
    21

    Question Google Sheets: Requests Handling Automation

    Hi everyone!
    I am new on the forum and generally in Javascript coding.

    I am part of a small association that asked me to create a form to group and handle input requests from volunteers.
    Needing a free and familiar solution, I chose Google Forms to collect requests. There are 3 fields to fill in: name, request (multiple choice), belonging department (multiple choice).
    Editing to my use already existing guides (search "Send email from Google Sheets based on a schedule" on Google), I created a basic program with AppsScript: requests are automatically imported into a Google Sheet, then grouped in JSON format and finally sent via e-mail. Adding a time trigger, I can receive a daily summary e-mail in text. It can be also changed the design into a more pleasing HTML table.

    The problem is that for my purpose isn not enough: the list of requests should always be kept compact (without empty rows), updated (for each user only the most recent request is kept and after 24h it is removed) and grouped by belonging department.
    I do not have deep knowledge in Javascript coding (neither other volunteers): I can modify the source code for my needs, but I am not able to write it from scratch.
    Here is the flowchart and related source code of the program.
    I would be willing to work with you to solve this issue.

    Regards.
    Attached Files Attached Files
    Last edited by Micheal_Benton; 09-26-2022 at 01:15 PM.

  2. #2
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,147

    Re: Google Sheets: Requests Handling Automation

    Sorry, but I couldn't understand the problem..... Is the problem the blank rows in range "Stocks" ?

  3. #3
    Registered User
    Join Date
    09-26-2022
    Location
    London, England
    MS-Off Ver
    Microsoft Office 365 2021
    Posts
    21
    Quote Originally Posted by Haluk View Post
    Sorry, but I couldn't understand the problem..... Is the problem the blank rows in range "Stocks" ?
    Hi, thanks for the reply.
    Yes, that's one problem. If you look closely on the flowchart, you can see that from the rhombus shape to the bottom, there are various actions that need to be implemented in the attached source code.
    Btw note that I copied the original source code, without the variables modified by me, but I don't think this matters very much.

    If you want, I can send you the pictures of the Google Sheet and form, even if all the instructions to create the project were adapted by the website I linked before.

    Let me know!
    Regards.

  4. #4
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,147

    Re: Google Sheets: Requests Handling Automation

    Related with the blank rows in range "Stocks", you can use a filter to exclude them.

    So; assuming that the named range "Stocks" is referring to columns A, B and C where the cells A1, B1 and C1 are housing the headers, you can use the following revision.

    Please Login or Register  to view this content.
    I am not sure what are the other problems.

  5. #5
    Registered User
    Join Date
    09-26-2022
    Location
    London, England
    MS-Off Ver
    Microsoft Office 365 2021
    Posts
    21

    Question Re: Google Sheets: Requests Handling Automation

    Quote Originally Posted by Haluk View Post
    Related with the blank rows in range "Stocks", you can use a filter to exclude them.

    So; assuming that the named range "Stocks" is referring to columns A, B and C where the cells A1, B1 and C1 are housing the headers, you can use the following revision.

    Please Login or Register  to view this content.
    I am not sure what are the other problems.
    Hi,
    thanks for your reply and suggestion!

    I'm sorry I couldn't explain well all the problems, I'll try again to explain what the program can and cannot do.
    1) CAN:
    a) send emails, based on a daily time trigger, that show all form's replies.

    2) CANNOT:
    a) copy in another cell the infos to bypass the "column copy/paste/trim block" (in simple terms, I can't move upwards the cells, they are blocked, try yourself).
    b) if the name isn't already stored in the sheet, then add it at the bottom cell; instead if there is, remove the old replies and replace them with the most recent one. After 24 hours, remove this reply to make space to new ones.
    c) remove empty rows and move upwards the bottom ones is needed for point b) to work: after I've removed old replies, I'm left with some blank rows, so I need to compact the remaining cells in less space.
    d) group all rows by the same belonging department to make a clean workflow, referencing the related "Belonging department" cell in the sheet.

    This actions need to be automated with code and added in the already existing source code.
    I'll also attach all the related screenshots needed to solve this problem.

    Let me know!
    Regards.

    1.png

    2.png

    3.png

    4.png

    5.png
    Last edited by Micheal_Benton; 09-28-2022 at 10:36 AM.

  6. #6
    Registered User
    Join Date
    09-26-2022
    Location
    London, England
    MS-Off Ver
    Microsoft Office 365 2021
    Posts
    21

    Question Re: Google Sheets: Requests Handling Automation

    My apologies, I am new in the world of forums and I did not know about the cross-posting rule...

    For fairness, I will write it below:
    The following answer was also cross-posted over another forum (UiPath Forum --> forum.uipath.com/t/appsscript-code-to-send-google-sheet-columns-via-e-mail/477128).
    Based on this rule, you should publish your next answers in that forum to maintain a single discussion.



    Regarding the source code, here it is:
    Source Code (Updated).pdf
    Last edited by Micheal_Benton; 09-29-2022 at 02:41 PM.

  7. #7
    Registered User
    Join Date
    04-07-2019
    Location
    Turkey-Ankara-Çubuk
    MS-Off Ver
    Office 2010
    Posts
    51

    Re: Google Sheets: Requests Handling Automation

    Hi, try this.


    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    09-26-2022
    Location
    London, England
    MS-Off Ver
    Microsoft Office 365 2021
    Posts
    21

    Re: Google Sheets: Requests Handling Automation

    Hi veyselemre, thanks for your help!
    I've edited the reply: you can find it below.
    Last edited by Micheal_Benton; 10-04-2022 at 11:48 AM.

  9. #9
    Registered User
    Join Date
    09-26-2022
    Location
    London, England
    MS-Off Ver
    Microsoft Office 365 2021
    Posts
    21

    Question Re: Google Sheets: Requests Handling Automation

    I showed my association the work and they were impressed.
    However, they pointed out 4 edits to your source code to make it 100% perfect.

    1) They changed the position of 2 columns ("Belonging department" column is now at the left of "Request"). The source code should work on the new positions (I wouldn't want to mess with variables myself).

    2) They would want a blank row between one department and another to keep order.

    3) They added the option "delete_previous_request" to the "Request" cell. The sheet already keeps the most recent row for every user: in this case, it should delete the most recent row with "delete_previous_request" under the "Request" column, because the user doesn't want to be on the sheet anymore.

    4) They added a column "Keep request after 24h". You can answer "NO" (the request would be deleted after 24h) or "YES" (the sheet would keep the request beyond 24h).
    This column does not have to affect other actions (e.g. if a request is kept beyond 24h, it will continue to be grouped by department or replaced with the most recent request).

    Feel free to ask me for any troubles.
    Any help would be highly appreciated!


    Google Sheet: //h t t p s : //docs.google.com/spreadsheets/d/1oLs0Iu_BFMPaLwQvq8USCeBoYxwGnWq53LqvZlZ3fIM/edit?usp=sharing
    Google Form: //h t t p s : //forms.gle/hi8XBib7tw6buWdC8


    1.PNG

    2.PNG

    3.PNG
    Last edited by Micheal_Benton; 10-04-2022 at 12:06 PM.

  10. #10
    Registered User
    Join Date
    04-07-2019
    Location
    Turkey-Ankara-Çubuk
    MS-Off Ver
    Office 2010
    Posts
    51

    Re: Google Sheets: Requests Handling Automation

    Hi,
    I don't know English, I translate with google translate. As far as I understand, I tried to answer your requests.

    Please Login or Register  to view this content.
    Last edited by veyselemre; 10-05-2022 at 11:10 AM.

  11. #11
    Registered User
    Join Date
    09-26-2022
    Location
    London, England
    MS-Off Ver
    Microsoft Office 365 2021
    Posts
    21

    Thumbs up Re: Google Sheets: Requests Handling Automation

    Hi veyselemre,
    no problem: I realize perfectly that it can be harsh to create source codes basing yourself only on requirements written by another user.
    But, despite the toughness, I can say that you hit the spot!

    Thank you very much indeed.
    Last edited by Micheal_Benton; 10-24-2022 at 06:30 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Google SHeets: Count Checked checkboxes in filtered data of google sheet
    By Faizan Naseem in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 1
    Last Post: 07-07-2022, 05:42 AM
  2. Google Sheets. Can I connect offline data from excel to google sheets?
    By drlemur39 in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 3
    Last Post: 11-15-2021, 10:40 AM
  3. (Google App Scripts) Copy and paste value for all Google Sheets contained in one folder
    By bobbiekan in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 4
    Last Post: 09-29-2021, 11:48 PM
  4. [SOLVED] Google sheets vba to download file and save it to google drive folder and use it's data
    By western in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-14-2021, 08:48 AM
  5. Google Apps Script for Google Sheets Pulling Formulas from Master to Several Slave Sheets
    By excelroofing in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 4
    Last Post: 08-22-2018, 02:06 AM
  6. Google Search Automation Errors
    By gsmith67 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-15-2014, 06:09 PM
  7. Data handling and VBA functions (Automation of task questions)
    By shelbert13 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-19-2012, 12:26 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1