Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

CDS Current Environment Trigger on Date Range

I'm attempting to setup a flow which triggers on a CDS (Current Environment) create, specifically around date.


I'm using the Filter Expression using a few conditions, and one looking at a date range of the 'arrivaldate' field.

I want this to trigger when that Arrival Date is in the next 3 days.

Using FetchXML Builder (thanks be to our lord Jonas) which usually works out, but its failing on the below where I am assuming the Dynamics expression for NextXDays doesn't exist in an OData format.


Is there a way to write this expression with OData? Or should I look at a different method? Not the Current Environment trigger perhaps.


Error below:


  "error": {
    "message""Exception parsing (siteid eq '********' and status eq 215500001 and Microsoft.Dynamics.CRM.NextXDays(Name='arrivaldate',PropertyValue=3)) and (PrimaryGuest/contactid ne null) submitted for attribute filterexpression of callback registration. Target entity: booking. Exception: Microsoft.OData.ODataException: An unknown function with name 'Microsoft.Dynamics.CRM.NextXDays' was found. This may also be a function import or a key lookup on a navigation property, which is not allowed.\r\n   at Microsoft.OData.UriParser.FunctionCallBinder.GetUriFunctionSignatures(String functionCallToken, Boolean enableCaseInsensitive)\r\n   at Microsoft.OData.UriParser.FunctionCallBinder.BindAsUriFunction(FunctionCallToken functionCallToken, List`1 argumentNodes)\r\n   at Microsoft.OData.UriParser.FunctionCallBinder.BindFunctionCall(FunctionCallToken functionCallToken)\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)"

Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,886)