Greenly® enables you to assess and calculate your company's direct and indirect Scope 1, 2, and 3 carbon emissions.
With the Workiva Platform, you can build chains to automatically download carbon footprint and activity data from Greenly into a table. You can then use the table as a source for a query or spreadsheet connection, such as include in Environmental, Social, and Governance (ESG) or sustainability disclosures.
Note: While you build multiple chains in these instructions, you'll run only one chain — which then automatically runs the others — to download data from Greenly into the table.
Prerequisites
To build these chains, first set up these connectors in Chains:
- Workiva connector
- File Utilities connector
- Tabular Transformation connector
- JSON connector
- HTTP connector
Tip: All of the chains' commands use the default CloudRunner. No GroundRunners are needed.
To enable integration with Greenly, request these from your Greenly administrator:
- Your company ID
- Your account's client ID and secret
Also note the IDs for the Greenly lead sheet Spreadsheet, its Control sheet section, and its connected table.
Build chain to log Greenly downloads
To automatically update the Control sheet section of the Greenly lead sheet Spreadsheet when you download data from Greenly.
- From Chains, click Create, and select Create chain.
- Enter a name and description to help explain that the chain logs data downloads from Greenly, and click Save.
- From Trigger event, drag Runtime inputs to Start.
- Select Runtime inputs, and click Edit.
- In Variables, these TextField inputs, with no default values:
- Range
- Spreadsheet ID
- Sheet ID
- Select Required for each variable, and click Save.
- From Available connectors, select File utilities, and move Create file to the canvas.
- Drag a link from Runtime inputs to Create file.
- Select the Create file command, and click Edit.
- In Basic info, enter a name and description to help identify the command.
- Enter the command's properties, and click Save:
Property Value Connector Select the File utilities connector to use. Text Create the text of the log message: - Enter
Emissions data refreshed on
. - Select the SystemDateTime variable from Runtime.
- Enter
- From Available connectors, select Workiva, and move Write sheet data to the canvas.
- Drag a link from Create file to Write sheet data.
- Select the Write sheet data command, and click Edit.
- In Basic info, enter a name and description to help identify the command.
- Enter the command's properties, and click Save:
Property Value Connector Select the Workiva connector to use. Spreadsheet ID Select the Spreadsheet ID runtime input from Trigger. Sheet ID/name Select the Sheet ID runtime input from Trigger. Data file Select the Created file output from Create file. Delimiter Select the comma (,). Region Select the Range runtime input from Trigger. Use async Clear this checkbox. Use Platform API Select this checkbox. - Click Publish, enter a note about the chain's publication, and click Publish.
Build chains from the Load Data to Wdata template
To start, use the Load Data to Wdata template to build chains to update the table with the data downloaded from Greenly. The Load Data to Wdata template creates chains that work together to:
- Determine whether the dataset already exists in the table
- Update the table with the latest dataset
To create the chains from Templates, open the Load Data to Wdata | Primary chain template, and click New chain.
Build a chain to download data from Greenly
Then, build a chain to download and import data from Greenly.
Step 1. Create the chain
- From Chains, click Create, and select Create chain.
- In Setup, enter a name and description to help explain that the chain downloads data from Greenly.
- In Variables, add these variables, and click Save:
Name Value Table ID Enter the ID for the table to upload the data into. Greenly client ID Enter the client ID for your company's Greenly account. Greenly client secret Enter the client secret for your company's Greenly account. Greenly audience Enter https://corporate.greenly.earth/api/v2
.Greenly company ID Enter the ID for your company's Greenly account. Spreadsheet ID Enter the ID for the Greenly lead sheet Spreadsheet. Sheet ID Enter the ID for the Control sheet section of the Spreadsheet.
Step 2. Add commands to download data from Greenly
To download carbon footprint data from Greenly:
- From Available connectors, select HTTP, and move Post to Start.
- Select the Post command, and click Edit.
- In Basic info, enter a name and description to help identify the command.
- Enter the command's properties, and click Save:
Property Value Connector Select the HTTP connector to use. Show response Select the checkbox. URL Enter https://greenly-production.eu.auth0.com/auth/token
.Content type Select application/json. Body text Create the text of the payload for authentication: - Enter
{"client_id":"
. - Select the Greenly client ID variable from Chain.
- Enter
","client_secret":"
. - Select the Greenly client secret variable from Chain.
- Enter
","audience":"
. - Select the Greenly audience variable from Chain.
- Enter
","grant_type":"client_credentials"}
.
Output schema Enter the sample response: {"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Im80VnNKMERMdlJhOW0zTWNwZ1BJXyJ9.eyJhdXRob3JpemVkX2NvbXBhbmllcyI6WyJjMTUxYjMwNi0yODY5LTQwM2YtYWY4OS0wMTBhYmJkMTUwNDkiXSwiaXNzIjoiaHR0cHM6Ly9ncmVlbmx5LXByb2R1Y3Rpb24uZXUuYXV0aDAuY29tLyIsInN1YiI6IjM3VFhpRGU3bWxGbGh5cG9yWjlhN1c3Mmt3bkFUMmkyQGNsaWVudHMiLCJhdWQiOiJodHRwczovL2NvcnBvcmF0ZS5ncmVlbmx5LmVhcnRoL2FwaS92MiIsImlhdCI6MTY5NjM2NTgzNiwiZXhwIjoxNjk2NDUyMjM2LCJhenAiOiIzN1RYaURlN21sRmxoeXBvclo5YTdXNzJrd25BVDJpMiIsInNjb3BlIjoicmVhZDphY3Rpdml0aWVzIiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIn0.kA-6hrCShQ7usZhIR2Bl5eBoJHCoKQNc3NvHtv8uRtjDvH2DMdIxQeIsD7_GmT-_b4CxVPxPpEwy24UCTuDTmBQiI9JgKcprp-40uCzOzan2v5U7nXbcT5Z7uiN4QE15kcIevWGuZAQ11K23h_ftISwAOQR18F-kT03mHtklNoGwLZiETze12lTvDjMKy2NzFIUL7CP1yBgtTDoSc3j_oJC_M780Dc_hW_IfuHHDXMXmOdzp9d6lPzOfAhjyb33l5KKho5YjwJGtrCzKU6kRhY4txeMdrAjsx0IZ61ThFezXWJUSqo30_kTSBxG7Dje5TA-B2i0xBhSgcKZB_iFWUg","scope":"read:activities","expires_in":86400,"token_type":"Bearer"}
- Enter
- From Available connectors, select HTTP, and move Get to the canvas.
- Drag a link from Post to Get.
- Select the Get command, and click Edit.
- In Basic info, enter a name and description to help identify the command.
- Enter the command's properties, and click Save:
Property Value Connector Select the same HTTP connector as Post. Show response Select the checkbox. URL Enter https://corporate.greenly.earth/api/v2/activities/audit-export
.Query string Create the query string: - Enter
companyId=
. - Select the Greenly company ID variable from Chain.
- Enter
&expand=carbonFootprint&limit=100&offset=1
.
Headers Add this header: - In Key, enter Authorization.
- In Value, select Token_type and then Access_token from the Response output of Post.
Content type Select application/json. Output schema Enter the sample response: {"data":[{"activityId":"297b29b1-a474-4fa5-a9fd-f80ff5fd7e4d","ownerCompanyId":"c151b306-2869-403f-af89-010abbd15049","ownerProfileId":"e620cee6-97e2-4f02-8ef1-c928d4cf8649","companyId":"c151b306-2869-403f-af89-010abbd15049","profileId":"e620cee6-97e2-4f02-8ef1-c928d4cf8649","companyName":"Demo for Greenly Certified Partners","fiscalYear":"2022","temporalScopeStart":"2022-11-03","temporalScopeEnd":"2022-11-03","regulatoryMethodology":"BEGESv4","scope":"Scope 3","subScope":"9","subScopeName":"Purchases of goods and services","siteName":null,"actualsEstimate":"Actuals","parentBusinessCategory":"Services purchase","businessCategory":"Bank fees and services","activityName":"comm tenue compte [services bancaires]","activityType":"Expense-Based","source":"Accounting","quantity":5.73,"quantityForSubScope":5.73,"unit":"EUR","conversionFactor1Value":null,"conversionFactor1Name":null,"conversionFactor1InputUnit":null,"conversionFactor1OutputUnit":null,"conversionFactor1Methodology":null,"conversionFactor2Value":null,"conversionFactor2Name":null,"conversionFactor2InputUnit":null,"conversionFactor2OutputUnit":null,"conversionFactor2Methodology":null,"conversionFactor3Value":null,"conversionFactor3Name":null,"conversionFactor3InputUnit":null,"conversionFactor3OutputUnit":null,"conversionFactor3Methodology":null,"emissionFactorName":"Bank fees and services","emissionFactorNameAndUnit":"Bank fees and services (EUR)","emissionFactorValue":0.11,"emissionFactorInputUnit":"EUR","emissionFactorOutputUnit":"KGCO2E","emissionFactorReferentialType":"GREENLY MEF","emissionFactorReferentialYear":null,"emissionFactorGeographicalValidity":"","emissionFactorReferentialDescription":"","emissionFactorReferentialCategory":"","emissionFactorMethodology":"0.11 kgCO2e/€. This monetary factor comes from the French agency for the ecological transition (ADEME). It is provided for the category 'Service - Insurance, banking, consulting and fees' ('Service - Assurance, services bancaires, conseil et honoraires'). More information is available on the ADEME website. See https://www.bilans-ges.ademe.fr/en/accueil/documentation-gene/index/page/Ratio-monetaires","percentEmissionsInScope":"1.00000000000000000000","emissionsInKGCO2e":0.63,"emissionsIntCO2e":0.00063,"entityCreatedAt":"2023-04-20T13:44:14.010Z","versionCreatedAt":"2023-11-12T12:36:12.598Z","granularType":"Transaction","supplierName":null,"marketBased":"Location-Based","isCrossEntity":false,"shouldBeExcluded":false,"purchaseCategoryId":"73679b6b-7f02-4292-a473-0aee658300b4","language":"en"}],"limit":1,"offset":1,"orderBy":"entityCreatedAt","order":"ASC","totalCount":2568}
- Enter
Step 3. Add commands to create a JSON of the data
To save the downloaded data as JavaScript Object Notation (JSON):
- From Available connectors, select Workiva, and move Create query to the canvas.
- Drag a link from Get to Create query.
- Select the Create query command, and click Edit.
- In Basic info, enter a name and description to help identify the command.
- Enter the command's properties, and click Save:
Property Value Connector Select the same Workiva connector as the chain created to log data downloads. Name Enter a name for the temporary query. Query text Create the query string: - Enter
select row_number() over ( order by a) as R, a from
.
(select a from unnest(sequence(0, - Select TotalCount from the Response output of Get.
- Enter
,1000)) t(a))
.
Temporary Select this checkbox. - Enter
- From Available connectors, select Workiva, and move Run query to the canvas.
- Drag a link from Create query to Run query.
- Select the Run query command, and click Edit.
- In Basic info, enter a name and description to help identify the command.
- Enter the command's properties, and click Save:
Property Value Connector Select the same Workiva connector as earlier. Query ID Select Id from the Query output of Create query. - From Available connectors, select Workiva, and move Download query result to the canvas.
- Drag a link from Run query to Download query result.
- Select the Download query result command, and click Edit.
- In Basic info, enter a name and description to help identify the command.
- Enter the command's properties, and click Save:
Property Value Connector Select the same Workiva connector as earlier. Query result ID Select Id from the Query result output of Run query.
- From Available connectors, select Workiva, and move Delete query to the canvas.
- Drag a link from Download query result to Delete query.
- Select the Delete query command, and click Edit.
- In Basic info, enter a name and description to help identify the command.
- Enter the command's properties, and click Save:
Property Value Connector Select the same Workiva connector as earlier. Query ID Select Id from the Query output of Create query. - From Available connectors, select JSON, and move CSV to JSON to the canvas.
- Drag a link from Delete query to CSV to JSON.
- Select the CSV to JSON command, and click Edit.
- In Basic info, enter a name and description to help identify the command.
- Enter the command's properties, and click Save:
Property Value Connector Select the JSON connector to use. Input file Select the Query result output of Download query result. Delimiter Select Comma (,).
Step 4. Create a command group to download all data
- Move Command group to the canvas, and drag a link from CSV to JSON to the group.
- Select the group, then click Edit.
- Select Iterators, and enable Iterate.
- Set up the iterator, and click Save:
Property Value Modifier type Select List. Iterations Select the JSON file output of CSV to JSON. - From Available connectors, select HTTP, and move another Get to the canvas.
- Drag a link from Group start to Get.
- Select the Get command, and click Edit.
- In Basic info, enter a name and description to help identify that the command retrieves activity data.
- Enter the command's properties, and click Save:
Property Value Connector Select the same HTTP connector as earlier. Show response Select the checkbox. URL Enter https://corporate.greenly.earth/api/v2/activities/audit-export
.Query string Create the query syntax: - Enter
companyId=
. - Select the Greenly company ID variable from Chain.
- Enter
&expand=carbonFootprint&limit=100&offset=
. - Select the JSON file iteration output from Group iterator.
- Click JSON file iteration, and add a Get value from JSON transformation.
- In Value, enter
a
. - Click Apply.
Headers Add this header: - In Key, enter Authorization.
- In Value, select Token_type and then Access_token from the Response output of Post.
Content type Select application/json. Output schema Enter the sample response: {"data":[{"activityId":"297b29b1-a474-4fa5-a9fd-f80ff5fd7e4d","ownerCompanyId":"c151b306-2869-403f-af89-010abbd15049","ownerProfileId":"e620cee6-97e2-4f02-8ef1-c928d4cf8649","companyId":"c151b306-2869-403f-af89-010abbd15049","profileId":"e620cee6-97e2-4f02-8ef1-c928d4cf8649","companyName":"Demo for Greenly Certified Partners","fiscalYear":"2022","temporalScopeStart":"2022-11-03","temporalScopeEnd":"2022-11-03","regulatoryMethodology":"BEGESv4","scope":"Scope 3","subScope":"9","subScopeName":"Purchases of goods and services","siteName":null,"actualsEstimate":"Actuals","parentBusinessCategory":"Services purchase","businessCategory":"Bank fees and services","activityName":"comm tenue compte [services bancaires]","activityType":"Expense-Based","source":"Accounting","quantity":5.73,"quantityForSubScope":5.73,"unit":"EUR","conversionFactor1Value":null,"conversionFactor1Name":null,"conversionFactor1InputUnit":null,"conversionFactor1OutputUnit":null,"conversionFactor1Methodology":null,"conversionFactor2Value":null,"conversionFactor2Name":null,"conversionFactor2InputUnit":null,"conversionFactor2OutputUnit":null,"conversionFactor2Methodology":null,"conversionFactor3Value":null,"conversionFactor3Name":null,"conversionFactor3InputUnit":null,"conversionFactor3OutputUnit":null,"conversionFactor3Methodology":null,"emissionFactorName":"Bank fees and services","emissionFactorNameAndUnit":"Bank fees and services (EUR)","emissionFactorValue":0.11,"emissionFactorInputUnit":"EUR","emissionFactorOutputUnit":"KGCO2E","emissionFactorReferentialType":"GREENLY MEF","emissionFactorReferentialYear":null,"emissionFactorGeographicalValidity":"","emissionFactorReferentialDescription":"","emissionFactorReferentialCategory":"","emissionFactorMethodology":"0.11 kgCO2e/€. This monetary factor comes from the French agency for the ecological transition (ADEME). It is provided for the category 'Service - Insurance, banking, consulting and fees' ('Service - Assurance, services bancaires, conseil et honoraires'). More information is available on the ADEME website. See https://www.bilans-ges.ademe.fr/en/accueil/documentation-gene/index/page/Ratio-monetaires","percentEmissionsInScope":"1.00000000000000000000","emissionsInKGCO2e":0.63,"emissionsIntCO2e":0.00063,"entityCreatedAt":"2023-04-20T13:44:14.010Z","versionCreatedAt":"2023-11-12T12:36:12.598Z","granularType":"Transaction","supplierName":null,"marketBased":"Location-Based","isCrossEntity":false,"shouldBeExcluded":false,"purchaseCategoryId":"73679b6b-7f02-4292-a473-0aee658300b4","language":"en"}],"limit":1,"offset":1,"orderBy":"entityCreatedAt","order":"ASC","totalCount":2568}
- Enter
- From Available connectors, select JSON, and move Array to CSV to the canvas.
- Drag a link from Get to Array to CSV.
- Select the Array to CSV command, and click Edit.
- In Basic info, enter a name and description to help identify the command.
- Enter the command's properties:
Property Value Connector Select the same JSON connector as earlier. JSON data Select Data from the Response output of the preceding Get. Multi-value delimiter Select the comma (,). Preview result Select the checkbox. Delimiter Select Comma. - Add these columns, then click Save:
Column name JSONPath activityID .activityID companyID .companyID companyName .companyName fiscalYear .fiscalYear temporalScopeStart .temporalScopeStart temporalScopeEnd .temporalScopeEnd regulatoryMethodology .regulatoryMethodology scope .scope subScope .subScope subScopeName .subScopeName siteName .siteName actualsEstimate .actualsEstimate parentBusinessCategory .parentBusinessCategory businessCategory .businessCategory activityName .activityName activityType .activityType source .source quantity .quantity quantityForSubScope .quantityForSubScope unit .unit conversionFactor1Value .conversionFactor1Value conversionFactor1Name .conversionFactor1Name conversionFactor1InputUnit .conversionFactor1InputUnit conversionFactor1OutputUnit .conversionFactor1OutputUnit conversionFactor1Methodology .conversionFactor1Methodology conversionFactor2Value .conversionFactor2Value conversionFactor2Name .conversionFactor2Name conversionFactor2InputUnit .conversionFactor2InputUnit conversionFactor2OutputUnit .conversionFactor2OutputUnit conversionFactor2Methodology .conversionFactor2Methodology conversionFactor3Value .conversionFactor3Value conversionFactor3Name .conversionFactor3Name conversionFactor3InputUnit .conversionFactor3InputUnit conversionFactor3OutputUnit .conversionFactor3OutputUnit conversionFactor3Methodology .conversionFactor3Methodology emissionFactorName .emissionFactorName emissionFactorValue .emissionFactorValue emissionFactorInputUnit .emissionFactorInputUnit emissionFactorOutputUnit .emissionFactorOutputUnit emissionFactorReferentialType .emissionFactorReferentialType emissionFactorReferentialYear .emissionFactorReferentialYear emissionFactorGeographicalValidity .emissionFactorGeographicalValidity emissionFactorReferentialDescription .emissionFactorReferentialDescription emissionFactorReferentialCategory .emissionFactorReferentialCategory.en emissionFactorMethodology .emissionFactorMethodology percentEmissionsInScope .percentEmissionsInScope emissionsInKGCO2e .emissionsInKGCO2e emissionsIntCO2e .emissionsIntCO2e entityCreatedAt .entityCreatedAt versionCreatedAt .versionCreatedAt granularType .granularType supplierName .supplierName marketBased .marketBased language .language isCrossEntity .isCrossEntity - From Available connectors, select Tabular transformation, and move Stack files to the canvas.
- Drag a link from Array to CSV to Stack files.
- Select the Stack files command, and click Edit.
- In Basic info, enter a name and description to help identify the command.
- Enter the command's properties, and click Save:
Property Value Connector Select the Tabular transformation connector to use. Delimiter Select Comma. Input files Specify the files to stack: - Select Previous stack files output from Stack files.
- Enter a comma (
,
). - Select the Converted file output from Array to CSV.
Preview results Select the checkbox.
Step 5. Add Run Chain events to upload and log downloaded data
To upload the carbon accounting data to Wdata:
- From Chain events, move Run chain to the canvas.
- Drag a link from the command group's Out to Run chain.
- Select the Run chain event, and click Edit.
- In Basic info, enter a name and description to help identify the event.
- In Chain to run, select the primary chain created from the Load Data into Wdata template.
- Enter the chain's runtime inputs, and click Save:
Input Value Table ID Select the Table ID variable from Chain. File name Enter activities.csv
.Data file Select Stack files output from Stack files. Load method Select Replace dataset. Rollback Clear this checkbox. - From Chain events, move another Run chain to the canvas.
- Drag a link between the two Run chain events.
- Select the new Run chain event, and click Edit.
- In Basic info, enter a name and description to help identify the event.
- In Chain to run, select the chain created to log when data downloads from Greenly.
- Enter the chain's runtime inputs, and click Save:
Input Value Range Enter B11:B11
.Spreadsheet ID Select the Spreadsheet ID variable from Chain. Sheet ID Select Sheet ID variable from Chain. - Click Publish, enter a note about the chain's publication, and click Publish.
To download data from Greenly into the Wdata table, select this chain in Chains, then click Execute and Run chain.