cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
StefanBrending
New Member

Common Data Service Trigger: Filter based on lookup value

Hi,

I am trying to trigger my Cloud Flow whenever a certain field on a linked entity is not null. Is there any way how to achieve that using the CDS (current) connector?

The equivalent OData query looks like this:

 

 

https://mysecretURL.crm4.dynamics.com/api/data/v9.1/accounts?$filter=(_originatingleadid_value ne null and originatingleadid/dw_hubspotid_str ne null) and (originatingleadid/leadid ne null)

 

 


I tried the following, but it wont work:

 

Approach.png

















I receive the following error message:

{
  "error": {
    "code""0x80040203",
    "message""Exception parsing _originatingleadid_value ne null and originatingleadid/dw_hubspotid_str ne null and originatingleadid/leadid ne null submitted for attribute filterexpression of callback registration. Target entity: account. Exception: Microsoft.OData.ODataException: Could not find a property named 'originatingleadid' on type 'CallbackRegistration.account'.\r\n   at Microsoft.OData.UriParser.InnerPathTokenBinder.BindInnerPathSegment(InnerPathToken segmentToken)\r\n   at Microsoft.OData.UriParser.MetadataBinder.Bind(QueryToken token)\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.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.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.ParseFilterImplementation(String filter, ODataUriParserConfiguration configuration, ODataPathInfo odataPathInfo)\r\n   at Microsoft.OData.UriParser.ODataQueryOptionParser.ParseFilter()\r\n   at System.Web.OData.Query.FilterQueryOption.get_FilterClause()\r\n   at System.Web.OData.Query.FilterQueryOption.ApplyTo(IQueryable query, ODataQuerySettings querySettings)\r\n   at System.Web.OData.Query.ODataQueryOptions.ApplyTo(IQueryable query, ODataQuerySettings querySettings)\r\n   at System.Web.OData.Query.ODataQueryOptions`1.ApplyTo(IQueryable query)\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__31_0(EdmModelEvaluator evaluator, String testValue)\r\n   at Microsoft.Crm.ObjectModel.CallbackRegistrationService.ValidateInputEntity(IBusinessEntity entity, ExecutionContext context, IFeatureDetailContainer featureDetailContainer)"
  }
}

Can someone help me solving this problem? Or isnt it possible at all?
1 REPLY 1
Mira_Ghaly
Dual Super User II
Dual Super User II

Hi @StefanBrending 

Let me understand you more you want to trigger the flow when the field originating lead on Account is Set?

 

If this is what you want to achieve please try the below:

Mira_Ghaly_0-1611367933374.png

 

After this you can use GetRecord to get the Lead Record and add further conditions / and filters

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (965)