GoodData.CN: Saving Layouts to Git

  • 19 April 2021
  • 0 replies
  • 128 views

Userlevel 1

With GoodData.CN, users can export a JSON Layout file with metadata on configurations for the LDM, measures, KPIs, Insights, and Dashboards. 

JSON Layout Example: layout.txt

wDHlLLN9O6PJmCO1tcNSzp_mVd-VuL5-l-yqAPIVjTCVrWTADEVjnuupwL5OFe3xiRvc3LaUTAzFgubRdlOWLS27l2o9qQMVEEsvrIrvaEIh_Z6AlQR59jH0alVtOwoVxtb7p5FFqECZvOn8Bg

 

You can update your workspace using the variety of built-in editing tools on GoodData.CN. But to commit such changes to a source control tool like Git, you will need to export the Layout file via API using the following command:

curl http://localhost:3000/api/layout/workspaces/<workspace_id> \

  -H "Content-Type: application/json" \

  -H "Accept: application/json" \

  -H "Authorization: Bearer <token>" \

  -X GET -o layout.json

* Substitute <workspace_id> and <token> with your specific parameters

 

This will create a file “layout.json” in your local directory, which can then be submitted to Git. These layout files can serve as backups for restoring workspace to their previous state. 

 

It is to your discretion on how often this layout.json file should be exported, but we recommend that exporting at least once a day for those with clients with editing permissions on their workspaces. For those with a smaller editor pool, we recommend exporting consistently either before or after making updates, as needed. 

 

For those who prefer creating updates directly through the layout file, users can update the layout file and post it via API call:

curl http://localhost:3000/api/layout/workspaces/<workspace_id> \

  -H "Content-Type: application/json" \

  -H "Accept: application/json" \

  -H "Authorization: Bearer <token>" \

  -X PUT   -d @layout.json

These edited files can then be pushed through source control as needed.


 

Example: Update the Customers Trend Insight

5-YXQIuVCQxippvbv3DFqj4gJs6X-pECKttUyfC83t96T8f5Nz_a32vdbx42fF_Em8_mHUcl11_8gLdJd444Yeb3dkrqTcNEglN_059yUAF2GgNza5hzRyHWW-cRh5jGX7HElebsYLlKcugg2Q

Changes: Trend by Quarter instead of month, different the color palette selection for both measures, moved the legend from the bottom to the top, and switched the Revenue per Customer insight from a Line to Column (bar) chart.

 

Git Diff on layout.json file:

7IR1O3a5urXsQtSm9MCQn4_H7Zs-6oN6B6idbRBXNcpvyPyGJZEg46dGhEvui047KlJcYYJrAAzsK4mOUgXTJQ8EgVP0GaHIFl_mrHsbkjVNUd_KLN6s5hE-D4T5DSg74eFfB0YaverreMpfEA

 

Git is a helpful tool for tracking changes and maintaining your parent workspace layouts, and any other configuration files for their child workspaces (info on hierarchical workspaces). Implementing version control through Git branches will allow you to maintain backups of your configurations. Older versions of your configurations can be quickly reapplied to your GoodData.CN workspaces to revert changes.

 

If you are interested in GoodData.CN, please contact us.

Alternatively, test a trial version of GoodData Cloud:

Start Your GoodData Analytics Trial — Commitment-Free


This topic has been closed for comments