■Overview
This is a flow to grant permissions so that each manager can view employee evaluation sheets stored in Google Drive.
Permissions are granted only when creating a new folder, and there is a distinction made when files are stored in an existing folder.
■Preparation
・Prepare a mapping sheet in a spreadsheet that shows the information of the manager corresponding to the employee of the target file in advance.
■Mapping Spreadsheet Used (View-only permission, so please copy or refer to it)
https://docs.google.com/spreadsheets/d/1PdxdTJyhhzVcOLbaZ42zKeFstcaQfU5w4-ovYN9v_zw/edit#gid=0
■Creation Method
① Select Google Drive from the app trigger, configure the following settings, and save.
・Trigger Action: When a new file or folder is created in a specific folder
・Trigger Interval: Set to the shortest interval of 5 minutes by default.
・Folder ID: Click the field and select the specified folder from the displayed options.
・Test: Store an arbitrary file in the target folder once and test to obtain information.
② Press the + mark, select an operation to manipulate and transform data, configure the following settings, and test/save.
・Transformation Type: Data Extraction (2 tasks)
・Target Text: Embed the output of the file name obtained in ① as {{File Name}}.
・Items to Extract: Extract items to be used later in mapping.
Example: If the file name contains "1111Tanaka", specify "Employee Number Name" to extract only that part from the file name.
※ For embedding output settings, please refer here. https://intercom.help/yoom/ja/articles/8223528
③ Press the + mark, select an operation to integrate with the app, choose Google Drive, configure the following settings, and test/save.
・Action: Search for files/folders in a specific folder
・Folder ID: Select the parent folder where each employee's folder is stored from the options.
・File Name: Embed the output name obtained in ② as {{〇〇}}.
④ Press the + mark, select a branching operation, configure the following settings, and save.
・Operation: Select the operation from ③.
・Output: Select the file ID obtained in ③.
・Condition: Select "Output is empty".
・Value: Leave it blank.
⑤ Press the + mark on the blank route (right route), select an operation to manipulate the database, choose the spreadsheet, configure the following settings, and test/save.
・Action: Retrieve records
・Spreadsheet ID: Select the mapping sheet prepared in advance from the options.
・Spreadsheet Tab Name: Select the sheet name.
・Table Range: Select the entire range including column names. For the example sheet, select A1:F.
・Condition for Retrieving Records: Select the column name to be matched, set it as equal, and embed the output extracted in ② as {{〇〇}}.
※ Ensure that the format of the values in the column to be matched matches the format of the output extracted in ②.
⑥ Press the + mark, select an operation to integrate with the app, choose Google Drive, configure the following settings, and test/save.
・Action: Create a folder
・Folder Name: Embed the output name obtained in ② as {{〇〇}}.
・Parent Folder ID: Select the parent folder where this folder will be created from the options.
⑦ Press the + mark, select an operation to integrate with the app, choose Google Drive, configure the following settings, and test/save.
・Action: Grant file or folder permissions to specified users
・Permissions to Grant: Select the specified permissions.
・File ID to Grant Permissions: Embed the output of the folder ID created in ⑥ as {{Created Folder}}.
・Email Address of User to Grant Permissions: Embed the manager's address obtained when retrieving records in ⑤.
⑧ Press the + mark, select an operation to integrate with the app, choose Google Drive, configure the following settings, and test/save.
・Action: Change the folder where the file is stored
・Target File ID: Embed the output of the file ID obtained in ① as {{File ID}}.
・Current Folder ID: Embed the output of the parent folder ID obtained in ① as {{Parent Folder ID}}.
・Destination Folder ID: Embed the output of the folder ID created in ⑥ as {{Created Folder ID}}.
⑨ Press the + mark on the non-blank route (left route), select an operation to integrate with the app, choose Google Drive, configure the following settings, and test/save.
・Action: Change the folder where the file is stored
・Target File ID: Embed the output of the file ID obtained in ① as {{File ID}}.
・Current Folder ID: Embed the output of the parent folder ID obtained in ① as {{Parent Folder ID}}.
・Destination Folder ID: Embed the output of the existing folder ID obtained in ③ as {{File ID_〇〇}}.
■Notes
・Ensure that the file name is consistent with the values stored in the mapping sheet.
・For example, if there is a value like "Employee Number Name (1111Tanaka)" in the mapping, name the file as "1111_Tanaka" and then add any desired name.
・Example: 1111Tanaka Evaluation Sheet etc.