${record.values.fieldName} filter quirk

We have begun using a new record list filter capability that allows third-party referencing of records. By third party I mean that Corteza now supports showing in Module A, a list of related records in Module C, by filtering on a record in Module B that is related to the currently viewed record in Module A, that exists in Modules A and C — it is a great feature, and thus avoids having to create additional fields for lookup purposes.

The filter looks like: FieldNameModuleC = ${record.values.FieldNameInModuleAthatExistsAsArecordInModuleB}

My question

  1. The filter works as expected, BUT it throws an error that says “Could not load record list: unknown attribute “undefined” used in query expression”. Is this a bug, or is the syntax wrong?

Curious if you ever figured this one out… I am seeing the same.

I understand that it was a bug in 2023.3.7 and earlier that caused this error message, and it was due to be corrected with 2023.3.8. But, we’ve just updated to 2023.9.0 today and the error message still appears.

Not sure if there was an existing issue for it to be fixed in 2023.3.8
If there was it must have been overlooked. The fix will be added to 2023.9.1 if possible.

1 Like

@mark, as far as I can see this bug only happens when you have the page open in a builder or are creating a new record, can you confirm?

The record object that is available in the builder(or when creating a new record) is basically a new record with default values. Hence that value is undefined. Since our server doesn’t accept undefined values this is expected.

Since this is not something we can handle for everyone you’ll need to change your prefilter configuration to:
FieldNameModuleC = ${record.values.FieldNameInModuleAthatExistsAsArecordInModuleB || "''"}

Or replace "''" with any other fallback value that suits your needs. Please note that for string values you need to wrap them in “” as in the example.

Solved - thanks @jfortun

The solution in my case was to use 0 in lieu of the “‘’”, as the record was a record selector.

Many thanks :pray:

1 Like