Filter Data Keys
Filter Data Keys decides which fields of your records continue through the flow. You can work in two ways: list the fields you want to keep, or list the ones you want to remove. It works with one record or a list, and it also reaches fields inside other fields, such as customer.address.city.
When to use it
- An API response brings a lot of data and you only need three or four fields, some of them nested.
- You want to remove internal or sensitive fields, such as
passwordorinternal_notes, before sending the data to a third party. - You are going to create rows in a spreadsheet and want each nested field to become a column.
Configuration
| Field | What it does |
|---|---|
| Input Data | The record or list of records you want to filter. |
| Filter Criteria | List of fields, one per line. For a field inside another, separate the levels with a dot: customer.email. Upper and lower case are treated the same. |
| Exclude Keys | Off (default): only the listed fields are kept. On: every field except the listed ones is kept. |
Output
The Filtered Data output returns one record if you sent one, or a list if you sent several.
- Keeping fields: the result has one field per list item, all at the top level. Dots in the name become underscores:
customer.emailbecomescustomer_email. If a record does not have that field, it appears empty. - Excluding fields: the record keeps its original structure, without the listed fields.
Example
A flow fetches orders from an online shop and wants to write them to a spreadsheet.
- Connect the order list to Input Data.
- In Filter Criteria, type
id,total,customer.nameandcustomer.email. - Leave Exclude Keys off. Each order comes out with the fields
id,total,customer_nameandcustomer_email, ready to become columns.
Related components
- Filter Data Values: filters records by the value of a field.
- Extract Data: keeps fields by their name or by how they start.
- Flatten By Key: turns a list inside a record into several records.