Had a question on renaming entity ids in the LDM. ...
# gooddata-cn
s
Had a question on renaming entity ids in the LDM. e.g We have an entity named ABC with the entity id as ABC and we are able to change the entity name to ABC2 but when we attempt to change the id to ABC2, it doesnt reflect after saving the changes (before saving the LDM). We need to update the Id as this is what is seen on the left panel when creating insights. Wanted to confirm that updating Ids is possible in the LDM and check how we can do that.
m
Hi Sagar, In GoodData CN renaming an entity ID in the Logical Data Model (LDM) is not directly supported via the UI because the entity ID is a fundamental reference, including in metrics, insights, etc. However, there are some ways to achieve this but they come with their own limitations: If the entity is not heavily used, the safest approach is to create a new entity with the desired ID and delete the old one. This method requires remapping relationships and potentially modifying existing insights and reports. Another approach would be to use our API: Firstly, you would export the current LDM JSON:
GET >
https://www.gooddata.com/api/v1/layout/workspaces/{workspaceId}/logicalModel Then update and rename the ID in the exported JSON and then re-upload the modified LDM JSON using:
PUT >
https://www.gooddata.com/api/v1/layout/workspaces/{workspaceId}/logicalModel This method is more flexible but requires careful validation to avoid breaking dependencies. The ID is a key reference in the model and is used internally by metrics, insights. Renaming it will break dependencies (metrics and reports, etc) that use that Attribute where you have renamed the ID https://www.gooddata.com/docs/cloud/api-and-sdk/api/api_reference_all/#operation/getLogicalModel
s
Michael, thanks for your response. Can you also pls. confirm that the text seen on the left panel as entity header when creating insights is the Id value ? If we decided to go via the export LDM route and re import it, will we see the new name in the left panel when creating insights ?
m
One more option to consider would be to export not just the LDM but whole workspace
GET /api/v1/layout/workspaces/{workspaceId}
this will not only export the logical model but the whole workspace (incl. all metrics, visualizations etc.) You can then refactor the ID - by replacing the old ID everywhere in the workspace - it should not matter that it is used anywhere. Once done, you can PUT the workspace layout back. What you can see in the Analyze left panel, for each object should be its name. For the collapsible “folders” these are actually taken from object “tags”. Initially the tag is created based on the dataset name and if you later change this name, the original tag remains, which is a bit confusing if you want to rename the dataset (and there is currently no UI for editing the tags), You can see (and modify) the tags for example in the model/workspace layout API output.
🙌 1
s
Thanks Michal !