Skip to content

Update GoogleSheets workflow to work with multiple country offices #241

@daissatou2

Description

@daissatou2

Background, context, and business value

WCS hopes to replicate the Aches Kobo/GoogleSheets/Asana setup across multiple sites. This means each site will have its own: Kobo form, Google Sheet and Asana Project.

The specific request, in as few words as possible

Update the existing Kobo to GoogleSheets to Asana workflow currently running on V1.
See updated steps in red in the workflow diagram.

Image

You will need to edit the Sync to GoogleSheets job (currently named GRM02.b Sync to GoogleSheets Aceh in v1) as follows:

  1. Query this master grm-DEPLOYED sheet to get mappings for the "source" kobo formuid (column B) and destination Google Sheet Link (column O).
  • NOTE: Only return rows where Google Sheet Link is defined, because not all Kobo form uids will have a matching target spreadsheet.
  1. This should output a mapping table that looks like this and defines routing rules from syncing Kobo data to different GoogleSheets:
const formSheetMap = {
  \\ uid: sheetId, 
  'aPY82ZadEVsiZLZCwAY4Ka': uTQRVKggUsj6wycRhBUU9ywixsOniBbEa0J8e9ruHHI,
  'a2SXkrerDvs2ZnwjaVKTYg': '1YKx81FDqK2hY9AAnwF1KjmqEDcIe-ymKVtMncbqjZOU'
}

Note that you'll need to parse the sheetId from the Google Sheet Link (e.g., https://docs.google.com/spreadsheets/d/1uTQRVKggUsj6wycRhBUU9ywixsOniBbEa0J8e9ruHHI/edit)

  1. Then based on the kobo form uid in the Input, map the data to the correct Google sheetId using this mapping table.

For the test cases described below, this means:

  • Input1 should result in 1 row added to this sheet (the first mapping rule)
  • Input2 should result in 1 row added to this other sheet (the second mapping rule).

⚠️NOTE BEFORE STARTING WORK⚠️

  • Work on a new branch based on master --> Do NOT merge to prod!
  • Job source code lives on this repo OpenFn-GrievanceRedressMechanism owned by WCS's org so it doesn't show up in our Zenhub view, which is why we logged this issue on this repo

Workflow/Job

The workflow has 2 steps. (Search the v1 project for GRM02 to see this.)

Image

Step 1

Step 2

Input & Testing Guidance

To generate an input for step 2 syncGsheet.js, run the workflow (both steps 1 and 2) using the following inputs:

Once you run these^ through both workflow steps, then you'll find Input1 should map to GoogleSheet1 (the first mapping rule), while Input2 should map to GoogleSheet2.

Credentials

Step1: Asana
For now use your own Asana Account - you have access to this project

Step2: Googlesheets
For now use your own Google Account - you have access to this master sheet with the mapping rules, as well as target sheet1 and target sheet2.

Toggl

WCS Support

Metadata

Metadata

Assignees

Labels

MediumComplexity levelP2Priority Level 2 - MediumPROD project 🚨Work on a branch! This project is live

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions