Hi, in the latest release notes, it mentions that ...
# gooddata-cloud
d
Hi, in the latest release notes, it mentions that the entity API for workspace data filters is now available. I'm trying to switch from using the layout api to using this method. The documentation is not clear however. (https://www.gooddata.com/developers/cloud-native/doc/cloud/workspaces/workspace-data-filters/#SetUpDataFiltersinWorkspaces-UsingEntityAPI) In step 1. The id is "<>" In Step 4. There is an object_id listed as part of the put call. What should this object_id be?(Also how can you do a put to create an object??)
1
m
I believe there are now some issues with this documentation article and I’ve made the doc team aware of it. Based on the API reference, I believe you can create new workspace data filter setting (=the list of values associated to a particular workspace and filter) by calling
POST /api/v1/entities/workspaces/<child_workspace_id>/workspaceDataFilterSettings
with payload:
Copy code
{
  "data": {
    "attributes": {
      "description": "any string",
      "filterValues": [
        "data value from filter column"
      ],
      "title": "any string"
    },
    "id": "your id of this setting",
    "relationships": {
      "workspaceDataFilter": {
        "data": {
          "id": "id of workspace data filter in parent workspce",
          "type": "workspaceDataFilter"
        }
      }
    },
    "type": "workspaceDataFilterSetting"
  }
}
where id in the “data” section can be whatever you want and “id” in the workspaceDataFilter section should point to the id of the workspace data filter defined in the parent workspace. And the call currently mentioned in the documentation you linked
PUT /api/v1/entities/workspaces/<child_workspace_id>/workspaceDataFilterSettings/<object_id>
is only for modification of the existing workspace data filter setting (while the object_id in the URL would be the value from the field
id
used while creating this setting.
j
This was sort of guerrilla implementation, feedback is more than welcome! P.S. relevant support in the Python SDK will come very soon.
d
Thanks Michael and Jan, after the documentation was updated, I can follow it and things work as expected.
👍 1