從Chain Builder ,您可以建立一個鏈,從 Enablon® 下載資料,例如您的溫室氣體 (GHG) 排放量,用於環境、社會與治理 (ESG) 或永續性報告。
必要條件
要建立此鏈,您將使用這些核心連接器:
- HTTP 請求 連接器
- 檔案公用程式 連接器
- XML 連接器
- Workiva connector, 如果您需要在試算表或 Wdata 表中使用資料
註記: 此連結的所有指令都使用預設的 CloudRunner。不需要 GroundRunner。
若要執行連鎖,您需要 Enablon 的詳細資訊才能存取資料:
- 用於下載資料的 Enablon 簡單物件存取通訊協定 (SOAP) 應用程式介面 (API) 端點
- 要存取的 Enablon 環境 ID
- 用於訪問環境的用戶名和密碼
步驟 1. 建立鏈結
- 從Chains ,按一下Create ,並選擇Create chain 。
- 在設定 下 ,輸入名稱和說明,以協助識別鏈及其目的。
- 在變數 下,為存取資料所需的 Enablon 詳細資訊新增變數:
- 端點
提示: 對於Endpoint 變數,請輸入預設值
ExportData,若要以 64 位元編碼格式下載資料,ExportBinaryData。 - 環境
- 使用者名稱
- 密碼
- 端點
- 按一下「儲存」(Save)。
步驟 2.從 Runtime Inputs 觸發事件開始
若要在每次鏈執行時過濾輸出,請從Runtime Inputs 事件開始,以提示要下載資料的條件。
- 將Runtime Inputs 從Trigger Events 下移動到Start 。
- 選擇Runtime Inputs 事件,然後按Edit 。
- 每次執行連鎖時,新增要請求的輸入:
顯示名稱 類型 必要 報告期間開始日期 日期欄位 是 報告期間結束日期 日期欄位 是 活動 TextField 或 DropdownField: - TextField,用於開啟文字欄位
- DropdownField,從特定選項清單中選擇
是 實體 ArrayField 是 - 按一下「儲存」(Save)。
步驟 3.新增 HTTP 請求連接器 POST 指令
若要從 Enablon 端點擷取資料,請設定HTTP connectorPOST 指令:
- 在Connectors 下 ,單擊HTTP ,並將POST 命令移動到畫布。
- 從Start 拖曳連結到POST指令。
- 選擇POST 指令,然後按編輯 。
- 在Command properties 下 ,選擇要使用的HTTP 連接器。
- 輸入命令的內容:
摘要資訊 說明 使用者名稱 選擇Chain 下的Username 變數。 密碼 選擇Chain 下的Password 變數 。 顯示回應 勾選此方塊。 URL|網址 選擇Chain 下的Endpoint 變數。 內容類型 輸入 text/xml. - 在Body text 中,輸入此 Extensible Markup Language (XML) 語法:
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:enab="enablon<4> <soapenv:Header> <UserInfo xsi:type="wsdl:AuthHeader" xmlns:wsdl="http://enablon/wsdl/"> <EnaHomeSite xsi:type="xsd:string<6>[Environment]</EnaHomeSite> <EnaUserName xsi:type=「xsd:string">[使用者名稱]</EnaUserName> <EnaPassword xsi:type=」xsd:string<8>[Password]</EnaPassword> </UserInfo> </soapenv:Header> <soapenv:Body> <enab:ExportData soapenv:encoding:Style="http://schemas.xmlsoap.org/soap/encoding/"> <Table>/sd/Entities/Data</Table> <FolderId>0</FolderId> <Fields>FolderPath|ReportingPeriod|Ref|IndicatorName|ValueNumber|LocalUnit|ValueList</Fields> <Filter>ReportingPeriod in ([ReportPeriodEndDate],[ReportPeriodStartDate]) AND Campaign in([Campaign]) AND Entities=[Entities] 2</Filter> <CSVSeparator>2</CSVSeparator> <FormatOptions>25</FormatOptions> <FormatType>3</FormatType> <ExportOptions>8192</ExportOptions> </enab:ExportData> </soapenv:Body> </soapenv:Envelope>
- 使用運行時輸入和鏈變量更新 XML 語法:
- 在標題中,將
[Environment],[Username], 和[Password]改為Chain 下各自的變數。 - 在正文中,將
[ReportPeriodEndDate],[ReportPeriodStartDate],[Campaign], 和[Entities]改為Trigger 下的運行時輸入。
- 在標題中,將
- 按一下「儲存」(Save)。
步驟 4.新增 File Utilities connector Find and Replace 指令
若要準備下載的 XML 資料,請新增File Utilities 連結Find and replace 指令,以修正角括弧和管道。
祕訣: 若要輕易區分尋找和取代 指令,請輸入名稱以識別每個指令所修復的字元,例如「尋找和取代起始角括弧」或「尋找和取代管道」。
- 在Connectors 下 ,單擊File Utilities ,然後將Find and replace 命令移動到畫布。
- 從POST 指令拖曳連結到Find and replace指令。
- 選擇Find and replace 指令,並按一下Edit 。
- 在Command properties 下,選擇要使用的File Utilities 連接器。
- 輸入命令的內容,然後按一下儲存 :
摘要資訊 說明 來源 選擇POST 指令的回應 輸出。 尋找 輸入代碼 取代 輸入起始角括號 ( <)。尋找語法 選擇精確。 - 在Connectors 下 ,按一下File Utilities ,並移動另一個Find and replace 指令到畫布。
- 在Find and replace指令之間拖曳連結。
- 選擇新的Find and replace 指令,然後按一下Edit 。
- 在Command properties 下,選擇相同的File Utilities 連接器。
- 輸入命令的屬性,然後按一下儲存 :
摘要資訊 說明 來源 選擇Find and replace 指令的Replaced result 輸出。 尋找 ENTER取代 輸入起始角括號 ( >)。尋找語法 選擇精確。 - 在Connectors 下 ,按一下File Utilities ,並將另一個Find and replace 指令移到畫布上。
- 在第二個和第三個Find and replace指令之間拖曳連結。
- 選擇第三個Find and replace 指令,然後按一下Edit 。
- 在Command properties 下,選擇相同的File Utilities 連接器。
- 輸入命令的屬性,然後按一下儲存 :
摘要資訊 說明 來源 選擇第二個Find and replace 指令的Replaced result 輸出。 尋找 ENTER取代 輸入管道 ( |)。尋找語法 選擇精確。
步驟 5.新增 XML 連接器元素清單至 CSV 指令
若要將下載的 XML 轉換為表格資料,請新增XML ConnectorElement list to CSV 指令:
- 在Connectors 下,按一下XML ,並將另一個Element list to CSV 指令移到畫布上。
- 從第三個Find and replace指令拖曳連結到Element list to CSV 指令。
- 選擇Element list to CSV 指令,然後按Edit 。
- 在Command properties 下 ,選擇要使用的XML 連接器。
- 輸入命令的內容:
摘要資訊 說明 來源 選擇第三個Find and replace 指令的取代結果 輸出。 根目錄的路徑 輸入 //Document/Record.預覽結果 勾選此方塊。 - 在Columns 下 ,為每個元素新增欄名稱和 XPath:
資料欄名稱 XPath 句號 /ReportingPeriod 標記 /Ref IndName /IndicatorName NumValue /ValueNumber 單元 /LocalUnit - 在多值分隔符 中,輸入逗號 (
,)。 - 按一下「儲存」(Save)。
步驟 6.新增檔案公用程式連接器 建立檔案指令
若要從表格資料建立逗點分隔值 (CSV) 檔案,請新增File Utilities connectorCreate file 指令:
- 在Connectors 下 ,按一下File Utilities ,然後將Create file 指令移到畫布上。
- 從元素清單至 CSV 指令拖曳連結至建立檔案指令。
- 選擇Create file 指令,然後按一下Edit 。
- 在Command properties 下 ,選擇與Find and replace 命令相同的File Utilities 連接器。
- 輸入命令的屬性,然後按一下儲存 :
摘要資訊 說明 文字 選擇元素清單轉為 CSV 指令的轉換檔案 輸出。 檔案路徑 選擇Runtime 下的Chain.Workspace 變數 ,並附加 \test.csv。
步驟 7.新增指令以使用 Workiva 中的資料
若要在 Workiva 平台中使用 CSV 資料,請新增Workiva 連結器指令,以使用Create file 指令與試算表或 Wdata 表的Created file 變數輸出。例如,要在 Wdata 表中添加 Enablon 數據作為數據集,請添加Run chain 事件,該事件使用從 Update datasets in a table 模板 創建的鏈。
步驟 8.發佈並執行鏈
要啟用鏈執行:
- 按一下發佈 。
- 輸入任何有關其出版的評論,然後按一下Publish.
執行鏈結:
- 從Chains ,從 Chain 的功能表中選擇Edit 。
- 按一下Chain Settings ,輸入變量值,然後按一下Save 。
注意: 對於Endpoint 變數,輸入
ExportData,或者,要以 64 位元編碼格式下載資料,ExportBinaryData。 - 單擊Execute 。
- 從監控 ,按一下運行輸入 ,輸入運行時間輸入,然後按一下啟動 。