cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

ODATA Not Equal for Two Fields

I'm trying to get a List Records from Dynamics 365 and I would like to filter the data by "Field1 ne Field2". When I run the Flow I get an error message: "The right side of the 'NotEqual' operator must be a constant value." Does anyone know of a workaround for this?

1 ACCEPTED SOLUTION

Accepted Solutions
SimonNie
Advocate II
Advocate II

I am pretty sure, that you can not do that. In Dynamics it is also not possible to build such a query.

 

Workaround:

Create a third field3 in Dynamics and fill it with a business rule on entity level

If field2 greater than field1 then set field3 to yes.

 

Then you can use field3 in your List Record

 

Simon

View solution in original post

3 REPLIES 3
SimonNie
Advocate II
Advocate II

I am pretty sure, that you can not do that. In Dynamics it is also not possible to build such a query.

 

Workaround:

Create a third field3 in Dynamics and fill it with a business rule on entity level

If field2 greater than field1 then set field3 to yes.

 

Then you can use field3 in your List Record

 

Simon

v-bacao-msft
Community Support
Community Support

Hi @Anonymous,

 

I agree with @SimonNie that when configuring a Filter query in many similar actions, the arguments to the right of the operator must be constants to be a reasonable configuration.

In addition, the workaround he provided is also worth using.

Or you could use Filter array action to filter the eligible records.

For example, field 1 is not equal to field 2.

61.PNG

Thus, Filter array output is actually the result of the list records being filtered.

You could then use the result of the Filter array output to configure the following action.

Take a try.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

My final solution was to use an "old school" workflow, which did allow me to check Field1 <> Field2 before moving to the update record step. However, @SimonNie did have a perfectly workable solution, so I'll mark that as Accepted.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (2,920)