'Power Automate D365 Virtual column OData Filter Error
I've been looking for some articles regarding this but havn't seen anyone have this issue. We are trying to reference a Virtual Field named "_ownerid_type". Expression: _ownerid_type eq 'systemusers' However it returns an error. I can see that the field is available in the Triggerbody and have performed similar filters with guids. Does anyone have any direction for me? Thanks in Advance.
virtual field in Trigger output
OData Filter Expression
{ "error": { "code": "0x80040203", "message": "Exception parsing _ownerid_type eq 'systemusers' submitted for attribute filterexpression of callback registration. Target entity: incident. Exception: Microsoft.OData.ODataException: Could not find a property named '_ownerid_type' on type 'CallbackRegistration.incident'.\r\n at Microsoft.OData.UriParser.EndPathBinder.GeneratePropertyAccessQueryForOpenType(EndPathToken endPathToken, SingleValueNode parentNode)\r\n at Microsoft.OData.UriParser.EndPathBinder.BindEndPath(EndPathToken endPathToken)\r\n at Microsoft.OData.UriParser.MetadataBinder.Bind(QueryToken token)\r\n
at Microsoft.OData.UriParser.BinaryOperatorBinder.GetOperandFromToken(BinaryOperatorKind operatorKind, QueryToken queryToken)\r\n at Microsoft.OData.UriParser.BinaryOperatorBinder.BindBinaryOperator(BinaryOperatorToken binaryOperatorToken)\r\n at Microsoft.OData.UriParser.MetadataBinder.Bind(QueryToken token)\r\n
at Microsoft.OData.UriParser.FilterBinder.BindFilter(QueryToken filter)\r\n at Microsoft.OData.UriParser.ODataQueryOptionParser.ParseFilter()\r\n
at System.Web.OData.Query.FilterQueryOption.get_FilterClause()\r\n
at Microsoft.Crm.ObjectModel.EdmModelEvaluator.EvaluateFilterExpression(String filterExpression, ODataQueryOptions queryOptions)\r\n at Microsoft.Crm.ObjectModel.EdmModelEvaluator.EvaluateFilterExpression(String filterExpression)\r\n at Microsoft.Crm.ObjectModel.CallbackRegistrationService.<>c.<.cctor>b__50_0(EdmModelEvaluator evaluator, String testValue)\r\n at Microsoft.Crm.ObjectModel.CallbackRegistrationService.ValidateInputEntity(IBusinessEntity entity, ExecutionContext context, IFeatureDetailContainer featureDetailContainer)" } }
Solution 1:[1]
Power Automate / Flow is returning that type property when a lookup is involved (for lookup here I mean standard and polymorphic lookup, owner and customer).
That property is not returned when executing a query against the Web API directly (I don't know if they are using some special annotations in order to retrieve it) but the @Microsoft.Dynamics.CRM.lookuplogicalname property contains the table name and in my opinion that should be checked, not the type one.
But you can't filter on these two properties (lookuplogicalname or type). Theoretically you can do a filter on the relationship column checking the id of the table, for example something like:
owninguser/systemuserid ne null
BUT Web API (more related to the OData implementation if I am correct) consider this kind of filter as Left Outer (not Inner Join) meaning it will return also rows where the records are actually owned by teams, making this kind of filter criteria useless (because you just want Cases owned by users if I understood correctly what you are doing).
As Alternative is to use a FetchXML query, but I am not aware of a way to execute a FetchXML query with the action you are using (the When a row is assigned to a user)
I know what I wrote is not a complete answer to your problem but it can give you some context on what is happening
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Guido Preite |
