I am looking to filter an odata request within power automate to return only records where the modifiedon date is greater than a specified value. I have thus far tried the following without success:
$filter=ModifiedOn%20gt%20datetime'2023-05-23T00:00:00.0000000Z'
{ "error": { "code": "", "message": "The query specified in the URI is not valid. Unrecognized 'Edm.String' literal 'datetime'2023-05-23T00:00:00.0000000Z'' at '14' in 'ModifiedOn gt datetime'2023-05-23T00:00:00.0000000Z''.", "innererror": { "message": "Unrecognized 'Edm.String' literal 'datetime'2023-05-23T00:00:00.0000000Z'' at '14' in 'ModifiedOn gt datetime'2023-05-23T00:00:00.0000000Z''.", "type": "", "stacktrace": "" } } }
$filter=ModifiedOn%20gt%20cast('2023-05-23T00:00:00.0000000Z','Edm.DateTimeOffset')
{ "error": { "code": "", "message": "The query specified in the URI is not valid. The binary operator GreaterThan is not defined for the types 'System.Nullable`1[System.DateTime]' and 'System.Object'.", "innererror": { "message": "The binary operator GreaterThan is not defined for the types 'System.Nullable`1[System.DateTime]' and 'System.Object'.", "type": "", "stacktrace": "" } } }
$filter=ModifiedOn%20gt%20'2023-05-23T00:00:00.0000000Z'
{ "error": { "code": "", "message": "The query specified in the URI is not valid. A binary operator with incompatible types was detected. Found operand types 'Edm.DateTimeOffset' and 'Edm.String' for operator kind 'GreaterThan'.", "innererror": { "message": "A binary operator with incompatible types was detected. Found operand types 'Edm.DateTimeOffset' and 'Edm.String' for operator kind 'GreaterThan'.", "type": "", "stacktrace": "" } } }
$filter=ModifiedOn%20gt%20datetimeoffset'2023-05-23T00:00:00.0000000Z'
{ "error": { "code": "", "message": "The query specified in the URI is not valid. Unrecognized 'Edm.String' literal 'datetimeoffset'2023-05-23T00:00:00.0000000Z'' at '14' in 'ModifiedOn gt datetimeoffset'2023-05-23T00:00:00.0000000Z''.", "innererror": { "message": "Unrecognized 'Edm.String' literal 'datetimeoffset'2023-05-23T00:00:00.0000000Z'' at '14' in 'ModifiedOn gt datetimeoffset'2023-05-23T00:00:00.0000000Z''.", "type": "", "stacktrace": "" } } }
Any suggestions for how to achieve this would be much appreciated. Thanks.