Does corteza support for nested filter?

hello guys

I have a module that has a record-selector field
I want to filter based on the fields of that linked record-selector on the records-list page
so it’s like a nested filter (nested query in SQL)

I tried several forms but no luck, is this supported ?
thanks

Currently, there is no elegant solution to filter records based on referenced records; refer to here.

You have two options:

a) perform multiple requests; firstly find all the relevant inner records and then filter the outer ones based on those.

b) create filter fields on the outer record which are copied over from the inner record using some workflow.

None of the two cases is ideal, but they’ll do the trick until we define something more proper.

@tjerman thanks for your input

for the first option how to implement it ? I didn’t got the idea!

Lets say you wish to get all of the customers that are subscribed to package A or package B but not to package C.

Firstly fetch the packages you’re interested in, so packages A and B.
The response of that query would be something like:

[{
  "recordID": "1"
},
{
  "recordID": "2"
}]

Then you can use those recordIDs to filter over your users; so the query would look something like:

package='1' OR package='2'

This would then result all users subscribed to one of the two packages.

I should note that this is only an option when working with automation (automation scripts or workflows).
From the UI you’d only have the second option (copying over those values).

Version 2022.3 will add a temporary solution to go 1 level deep.

thanks, @tjerman for your usual support

can’t wait :heart_eyes:
can you share with us the expected features/bug fixes in more details of the upcoming release?

1 Like

Hmm… I haven’t started chasing people to fill in the changelog yet, so we don’t have much written down yet.
More of that will be available through March so hold tight until then!

1 Like

@tjerman is the first option possible to implement in the record-list block?

The first one, as in “perform multiple requests”, is not available in the native record-list page blocks.

@tjerman what’s your suggestion for my following situation

I have a module called Call and the module has different types and each type has many different fields.
so I created a new module for each type and link it with the main Call module
it’s basically the parent-child relationship.
the thing is when I’m at the child module I need to display the fields of the parent module. this is fine if I have a few fields to copy (via workflow) in the child module but unfortunately I have many fields. I tried to copy 10 fields and the performance got worse.

as I said, I just wanna display the parent fields on the child record page. I couldn’t find a solution any suggestion would be much appreciated

That shouldn’t affect the performance; perhaps it is something else? Could you share the workflow in question?

I would probably do the same; copy the values around. Without context on what you’re doing, I can’t help more than that; perhaps you could rethink the data model (modules and their relations)?

@tjerman it’s affect it due to many triggers
will give a detailed example

Okay; can I please ask you to open up a new thread; I’m suspecting this will be out of context to this one.

1 Like