diff --git a/docs/4. Product Features/03. Flows/2. Flow Actions/12. Link Google Sheets.md b/docs/4. Product Features/03. Flows/2. Flow Actions/12. Link Google Sheets.md index 908b5b382..3cfa1cefc 100644 --- a/docs/4. Product Features/03. Flows/2. Flow Actions/12. Link Google Sheets.md +++ b/docs/4. Product Features/03. Flows/2. Flow Actions/12. Link Google Sheets.md @@ -4,7 +4,7 @@ ___ 15 minutes read Level: Intermediate - Last Updated: December 2025 + Last Updated: April 2026 @@ -42,9 +42,10 @@ ___ Screenshot 2024-02-29 at 1 38 46 PM -5. Open the Google sheet and click on share button on the right hand side to update the sheet permission to at least `Anyone with the link` can `View` +5. Open the Google Sheet and click on the share button on the top right. Add the service account email (from the JSON key) and grant the required access—Viewer (read-only) or Editor (read/write). + +Alternatively, if you prefer not to add the service account email, you can change the sheet persmission to “Anyone with the link can view.” -![image](https://user-images.githubusercontent.com/32592458/219550695-58224a6f-4312-4981-b518-1dd6de639e3a.png) 6. Copy the URL @@ -323,7 +324,7 @@ Paste the service account credentials in the provided field, and click on the `S Screenshot 2024-02-29 at 2 19 43 PM -9. Open the Google Sheet you want to write data on and click on the share button on the right-hand side. Update the sheet permissions and add the Service Account Identifier (The client email on the service account) as a user invited in the spreadsheet's Collaboration Settings with `Editor` permission. +8. Open the Google Sheet you want to write data on and click on the share button on the right-hand side. Update the sheet permissions and add the Service Account Identifier (The client email on the service account) as a user invited in the spreadsheet's Collaboration Settings with `Editor` permission. Screenshot 2023-05-18 at 11 23 49 PM @@ -337,30 +338,30 @@ Paste the service account credentials in the provided field, and click on the `S ### Configuring Writable Google Sheet in the Flow -12. Import the below sample flow from the Flow screen and click on `setting` icon to configure it. +11. Import the below sample flow from the Flow screen and click on `setting` icon to configure it. **Sample Flow** [Write to Google Sheet.json](https://drive.google.com/file/d/17AQ507LDoMx7-Us_fZxlvpOuKgDhV5AV/view?usp=sharing) -13. Here's how the imported flow would look like +12. Here's how the imported flow would look like Screenshot 2024-02-29 at 2 40 13 PM -14. The first node is the `Send Message` node, which asks the contact for input to be added to the sheet. +13. The first node is the `Send Message` node, which asks the contact for input to be added to the sheet. -15. The second node is the `Wait for Response` node with the result name sheet_input. The response from the contact will be saved in this result and can be referenced as `@results.sheet_input`. +14. The second node is the `Wait for Response` node with the result name sheet_input. The response from the contact will be saved in this result and can be referenced as `@results.sheet_input`. -16. The third node is the `Link Google sheet` node, used to add the user-entered text into the Google sheet. Click on this node to configure it. +15. The third node is the `Link Google sheet` node, used to add the user-entered text into the Google sheet. Click on this node to configure it. Screenshot 2024-09-25 at 10 53 03 AM -17. Under Action, select `Write` from the dropdown menu. -18. From the next dropdown select the sheet which was added in the earlier step -19. Specify the name of the subsheet where the content needs to be written -20. Specify the starting cell to start writing from +16. Under Action, select `Write` from the dropdown menu. +17. From the next dropdown select the sheet which was added in the earlier step +18. Specify the name of the subsheet where the content needs to be written +19. Specify the starting cell to start writing from Screenshot 2024-09-25 at 10 57 35 AM @@ -370,18 +371,34 @@ Paste the service account credentials in the provided field, and click on the `S 21. After configuring the flow, click on the `Preview` button located on the top right side of the screen to run the flow in the simulator. -23. In the simulator, you will see the first message from the `Send Message` node, which prompts you to enter text. +22. In the simulator, you will see the first message from the `Send Message` node, which prompts you to enter text. -24. Type the desired text that you want to see in the sheet, and then press Enter. +23. Type the desired text that you want to see in the sheet, and then press Enter. Screenshot 2024-02-29 at 2 36 46 PM -25. This will move the flow forward, and the data will be written to the Google Sheet. +24. This will move the flow forward, and the data will be written to the Google Sheet. -26. Open the Google Sheet to check the newly inserted data. +25. Open the Google Sheet to check the newly inserted data. Screenshot 2023-05-18 at 11 58 31 PM ___ +### Google Sheet Access via Service Account + +To ensure sensitive beneficiary data (PII) is protected,avoid linking Google Sheets in Anyone can read or Anyone can read/write modes. + +Instead, configure access via the Google Service Account linked to your Glific instance. + + +1.Open the Google Sheet you want to link. + +2. Click Share → Paste the service account email (from the JSON key) and set the permission to either Viewer (read-only) or Editor (read/write). +3. Link Sheet in Glific +4. Now the sheet will be access via the service account, respecting the permissions set. + + +image + ## Note - This functionality can be used to write upto 30 columns in google sheets