After you run an sql query in DataWorks, you can directly export the results to DingTalk as a DingTalk Sheet. This avoids the security risks of downloading query data as local Excel files.
Supported versions
This feature is available only in DataWorks Standard Edition and higher.
Configure DingTalk
Create a DingTalk app
-
Go to the DingTalk Open Platform, log in to the developer console in the upper-right corner, and switch to your target organization.
-
In the top navigation bar, click app development. The DingTalk Apps tab opens by default.
-
Click Create App on the right. In the dialog box that appears, configure the app name, app description, and app icon.
-
After you complete the configuration, click Save. The app configuration page opens.
Configure app permissions
On the application configuration page, click to go to the permission configuration page for the new application. On this page, you can configure different permissions for the application for different members of your organization.
-
Permission Scope: Configure the permission scope for the app to specify which members can use it.
-
Configure the app permissions as described in the following table:
Configure security settings
On the Application Configuration page, click to open the Security Settings page and configure the redirect URL (callback domain). The domain information is as follows:
-
Redirect URLs for regions in China:
China (Hangzhou): https://da-cn-hangzhou.data.aliyun.com/api/v1/oa/dingtalk/auth/callback China (Shanghai): https://da-cn-shanghai.data.aliyun.com/api/v1/oa/dingtalk/auth/callback China (Beijing): https://da-cn-beijing.data.aliyun.com/api/v1/oa/dingtalk/auth/callback China (Zhangjiakou): https://da-cn-zhangjiakou.data.aliyun.com/api/v1/oa/dingtalk/auth/callback China (Ulanqab): https://da-cn-wulanchabu.data.aliyun.com/api/v1/oa/dingtalk/auth/callback China (Shenzhen): https://da-cn-shenzhen.data.aliyun.com/api/v1/oa/dingtalk/auth/callback China (Hong Kong): https://da-cn-hongkong.data.aliyun.com/api/v1/oa/dingtalk/auth/callback China (Shanghai) Finance: https://da-cn-shanghai-finance-1.data.aliyun.com/api/v1/oa/dingtalk/auth/callback China (Beijing) Finance: https://da-cn-beijing-finance-1.data.aliyun.com/api/v1/oa/dingtalk/auth/callback China (Shenzhen) Finance: https://da-cn-shenzhen-finance-1.data.aliyun.com/api/v1/oa/dingtalk/auth/callback China North 2 (Beijing) - Gov 1: https://da-cn-north-2-gov-1.data.aliyun.com/api/v1/oa/dingtalk/auth/callback -
Redirect URLs for regions outside China:
Japan (Tokyo): https://da-ap-northeast-1.data.aliyun.com/api/v1/oa/dingtalk/auth/callback Singapore: https://da-ap-southeast-1.data.aliyun.com/api/v1/oa/dingtalk/auth/callback US (Virginia): https://da-us-east-1.data.aliyun.com/api/v1/oa/dingtalk/auth/callback US (Silicon Valley): https://da-us-west-1.data.aliyun.com/api/v1/oa/dingtalk/auth/callback UK (London): https://da-eu-west-1.data.aliyun.com/api/v1/oa/dingtalk/auth/callback Indonesia (Jakarta): https://da-ap-southeast-5.data.aliyun.com/api/v1/oa/dingtalk/auth/callback Germany (Frankfurt): https://da-eu-central-1.data.aliyun.com/api/v1/oa/dingtalk/auth/callback Malaysia (Kuala Lumpur): https://da-ap-southeast-3.data.aliyun.com/api/v1/oa/dingtalk/auth/callback Saudi Arabia (Riyadh): https://da-me-central-1.data.aliyun.com/api/v1/oa/dingtalk/auth/callback
-
You only need to enter the URL.
-
If you need to redirect to multiple regions, enter the URLs separated by a
,.
Publish the app
-
After you configure all the parameters, click to go to the Version Release page.
-
Click Create New Version to open the version information editor.
-
Configure the version details. On the version information editor, set the App Version and Version Description. Confirm the Content to Be Released and Visibility Scope, and then click Publish in the upper-right corner to release the app version.
Configure DataWorks
Connect the DingTalk app
Go to the SQL Query page.
Log on to the DataWorks console. In the target region, click in the left-side navigation pane. Click Go to DataAnalysis to open the Data Analysis page. In the left-side navigation pane, click SQL Query.
-
In the left navigation bar, click , and then click the Office Software Integration tab.
-
Select the DingTalk app integration option and configure its settings.
Parameter
Description
DingTalk app name
Go to , click the DingTalk app that you configured in Configure DingTalk, and then on the left navigation bar, click to view the App Name, Client ID, and Client Secret.
Client ID
Client Secret
-
After you complete the configuration, click Confirm to save the integration settings.
Query and export results
-
After you successfully obtain the query results by using SQL Query (Old Version), click in the upper-right corner of the results pane.
ImportantIf this option does not appear, go to and enable Allow Download for Query Result. For more information, see Data Query and Control.
-
In the Export to DingTalk Sheet dialog box, configure the parameters.
New sheet
Parameter
Description
Target file
Select Create New Sheet. Each export operation creates a new DingTalk Sheet file in the specified folder within DingTalk Docs.
Folder link
The link to the folder in DingTalk Docs where the exported spreadsheet will be saved.
Spreadsheet name
The name of the exported file.
Existing sheet
Parameter
Description
Target file
Select Import to Existing Sheet. Each export operation creates a new sheet within the selected spreadsheet and writes the query results to it.
Workbook ID
The ID of the spreadsheet to which you want to import the query results.
Sheet name
The name of the new sheet that will be created to store the exported results.