db query.addFilter(subtable field id, '=', value)

is it possible to use addfilter to search for the record that contains a subtable row with the key value?

or is the current approach to load all records and use a for loop through subtable records to find what I’m looking for?

1 Like

Hi Justin,

This is Kate from Ragic Support. From what you’ve described, it sounds like you’re trying to filter records on a Ragic sheet based on whether their subtable contains a row with a specific key value.

Just to confirm—are you hoping to apply this filter directly using addFilter(), or are you asking if the only current method is to load all records and manually check each subtable row in a loop?

Could you clarify your exact goal or use case a bit more? That’ll help us guide you to the best approach.

1 Like

that is correct, I’m hoping to apply this filter directly. I used subtables to manage many to many relationships. so the only way to see what A Records have a relationship to B Record, is to filter through the subtables.

this is an approach I have changed, but I need to migrate the data, so I have to sift through the old approach for now.

1 Like

Hi Justin,

Thanks for confirming!

At the moment, addFilter() can’t be used to directly filter based on subtable fields. Even if the subtable contains the data you’re looking for, it won’t return any results through this method.

As a workaround, we recommend creating a new sheet from the subtable. This will generate a standalone sheet containing all subtable rows. During this process, the system will prompt you to select a key field from the original (parent) sheet to serve as the link between the two sheets.

Once the new sheet is created, you can use addFilter() to search for the records you’re interested in. Then, using the key field from the parent sheet, you’ll be able to trace back and locate the corresponding records in the original sheet.

Here are some helpful resources to guide you through:

Hope this helps! Please feel free to let us know if there’s any further questions. Thank you.

1 Like

Oh gotcha, I’ll give that a shot. thank you!

2 Likes