I’m getting the error "Invalid cast from 'System.String' to 'System.Guid'"
I’m trying to filter a lookup in Freedom using the SDK, but this error occurs.
Here’s my code snippet:
await filter.addSchemaColumnFilterWithParameter(
sdk.ComparisonType.In,
"RecordId",
dokumenIds
);
From the log, the dokumenIds look like this:['283bfe2a-cbe9-4b4c-8baf-2959cd30b84d', '2693a56e-c6a4-40a9-a16e-429db38a9e09', '58f1338c-e20d-4662-93c1-a9da27633a00', '69658b3a-77f6-4d42-ae1f-c0e2dcdd7049', 'fbb5a32b-1a25-4c17-8945-d8c7c264b5f7', '1df81ea2-025f-4a19-9963-da5461c80507']
Like
sdk.ComparisonType.In does not exist. For a "column value is in list" type filter, you need to use filter.addSchemaColumnInFilterWithParameters instead of filter.addSchemaColumnFilterWithParameter (note the "In", and "parameters" instead of "parameter") and use the Comparison Type Equal. e.g. adapting your example:
await filter.addSchemaColumnInFilterWithParameters( sdk.ComparisonType.Equal, "RecordId", dokumenIds );