i want to remove a key from records returned in a ...
# ask-ai
g
i want to remove a key from records returned in a stream in the ui builder, how do i do that?
k
To remove a key (field) from records returned in a stream using the Airbyte UI Builder, you should use the "Transformations" feature in the Record Processing section. Here’s how you can do it: 1. In the UI Builder, go to the stream you want to modify. 2. Add a new transformation of type "remove" in the "Transformations" section. 3. Enter the path of the field you want to remove. For example, if you want to remove the field named
content
, set the path to
content
. Example: If your record looks like this:
Copy code
json {   "id": "123",   "name": "Foo",   "content": {     "html": "<html>...</html>"   } }
Setting the remove transformation path to
content
will result in:
Copy code
json {   "id": "123",   "name": "Foo" }
You can also remove nested fields by specifying the full path, and use glob patterns like
**
to remove all fields with a certain name at any level (e.g.,
**
,
name
removes all
name
fields anywhere in the record) or
*
for prefix matching (e.g.,
s*
removes all top-level fields starting with "s") [Transformations in UI Builder](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/record-processing#transformations). This approach allows you to remove sensitive or unnecessary fields before the data is sent to your destination.
g
@kapa.ai what if i want to remove a nested key with this hierarchy workflow.conditions?
k
A message from kapa.ai
To remove a nested key such as
workflow.conditions
from records in the Airbyte UI Builder, you should specify the path as a list of keys in the "remove" transformation. In this case, the path would be:
Copy code
workflow, conditions
This will remove the
conditions
key inside the
workflow
object. Here’s how you would configure it: - In the "Transformations" section, add a new transformation of type "remove". - Set the path to
workflow, conditions
. This approach is supported for removing deeply nested fields by specifying the path of properties to the target field that should be removed [Transformations in UI Builder](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/record-processing#transformations). Example: If your record is:
Copy code
json {   "workflow": {     "conditions": "to_remove",     "other": "keep"   },   "id": 1 }
After applying the transformation with path
workflow, conditions
, the result will be:
Copy code
json {   "workflow": {     "other": "keep"   },   "id": 1 }
This method works for any level of nesting by specifying the full path to the field you want to remove.