GoodData.CN: Saving Layouts to Git

  • 19 April 2021
  • 0 replies

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



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


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:



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.

0 replies

Be the first to reply!