for context,
Data source name: 'TEST_DATA_IN_DATAVERSEs'
Collection name: 'FilterCollection'
Collection Example:
| CustomIndex |
Field |
Operator |
Value |
| 1 |
CLIENT |
Equals |
TST |
| 2 |
SOURCE |
Equals |
Telephone |
| 3 |
VERSION_NUM |
Equals |
0 |
| 4 |
OTHER_SUBTYPE |
Contains |
Financial |
I'm trying to use the below formula in the items property of a gallery. if the collection is empty, it works fine, but if the collection is not empty, it is returning no records.
could someone give me a suggestion on how to work with this?. for more context, i'm trying to acheive a dynamic filtering.
If(
IsEmpty(FilterCollection),
TEST_DATA_IN_DATAVERSEs,
Filter(
TEST_DATA_IN_DATAVERSEs,
Concat(
FilterCollection,
Switch(
ThisRecord.Operator,
"Equals", ThisRecord.Field & " = " & Char(34) & ThisRecord.Value & Char(34),
"Does not equal", ThisRecord.Field & " <> " & Char(34) & ThisRecord.Value & Char(34),
"Contains", Char(34) & ThisRecord.Value & Char(34) & " in " & ThisRecord.Field,
"Does not contain", "!(" & Char(34) & ThisRecord.Value & Char(34) & " in " & ThisRecord.Field & ")",
"Is Greater than", ThisRecord.Field & " > " & ThisRecord.Value,
"Greater than or equal to", ThisRecord.Field & " >= " & Char(34) & ThisRecord.Value & Char(34),
"Is Less than", ThisRecord.Field & " < " & Char(34) & ThisRecord.Value & Char(34),
"Less than or equal to", ThisRecord.Field & " <= " & Char(34) & ThisRecord.Value & Char(34),
"StartsWith", "StartsWith(" & ThisRecord.Field & ", " & Char(34) & ThisRecord.Value & Char(34) & ")",
"EndsWith", "EndsWith(" & ThisRecord.Field & ", " & Char(34) & ThisRecord.Value & Char(34) & ")"
),
", "
)
)
)