I have 2 data filtering rules on the same user gro...
# gooddata-cloud
g
I have 2 data filtering rules on the same user group. How do I remove one of them?
k
To remove one of the user data filters (UDFs) assigned to a user group in GoodData Cloud, you need to use the API to delete the specific filter. The UDFs are managed via the Entity API or Declarative API, and each filter has a unique ID. You can delete a UDF by making a DELETE request to the appropriate API endpoint, specifying the filter ID you want to remove. The documentation provides the structure for creating and managing UDFs, but does not give a direct example for deletion. However, based on standard RESTful API practices and the available endpoints, you would use the DELETE method on the UDF resource. For example, the endpoint would look like:
Copy code
DELETE /api/v1/entities/userDataFilters/{filterId}
Replace
{filterId}
with the ID of the filter you want to remove. You must have the appropriate
MANAGE
permissions for the organization or workspace to perform this action. For more details on managing UDFs, see the official documentation: [Set Up Data Filters for Users](https://www.gooddata.com/docs/cloud/workspaces/user-data-filters/) and [API Reference](https://github.com/gooddata/gooddata-python-sdk/blob/master/gooddata-api-client/README.md)<source>https://www.gooddata.com/docs/cloud/workspaces/user-data-filters/&lt;/source>. If you are using the Python SDK, you would use the relevant method to delete the user data filter by its ID, but the exact SDK method is not detailed in the provided sources. If you need to update the set of filters (for example, remove one and keep the others), you can also use the Declarative API to set the complete list of UDFs you want to keep, omitting the one you wish to remove<source>https://www.gooddata.com/docs/cloud/workspaces/user-data-filters/#set-up-user-data-filters&lt;/source>. If you need more specific code examples or step-by-step instructions, please let me know!
g
The user data filter is valid for 1 user group but is assigned to 2 user groups, how do I remove it from one of the groups?
👀 1
j
Hi Greg, As far as I know, in the UDF JSON you can assign a specific UDF only to one user or one userGroup. It doesn’t allow you to include multiple user IDs or userGroup IDs in the same definition. If you want to apply the same filter to multiple users or groups, you need to create separate UDFs for each of them, each with a unique UDF ID.
So I believe we are talking here about two different filters (unique IDs) and you need to simply delete one of those. See the reply from our AI assistance describing the steps to do so.
g
There night be two separate udf ID's, I don't know. That's what I need help to determine. I ran a postman script using the wrong user group ID (that already had a filter) so now I wonder if that user group has two filters? if so I want to remove the incorrect one.
Whats the easiest way for you to see? Should I provide you the workspace id and the user group id? and you can see what data filters are on that group?
j
Yes, this situation is indeed possible. Multiple filters can be assigned to single user or userGroup. The best way to check is definitely using layout API:
api/v1/layout/workspaces/<workspace_id>/userDataFilters
From there you can get specific filter ID and simply deleted it as per above or amend whole layout endpoint (careful there as any changes would re-write all the content of the endpoint).
g
I ran that but it is jiberish. I'm going to need help. This is definitely an area where a UI instead of directly calling the API would be so helpful.
j
I would say you just need to search ID of the problematic group and check if multiple filters appearing in the endpoint are affecting this group. Does the endpoint work for you?
g
Sorry, I'm getting nowhere. can I give you the workspace id and the user group id and you can see what data filters are on that group?
j
Sure, we can check. Please send it over
i
Hello Greg, I am looking into this and I will update here as soon as possible. Thank you
g
This is resolved. Thank you Julius for helping me!
🙌🏼 1
i
I am glad to hear that. Have a nice day.