cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate III
Advocate III

SharePoint/Flow: Unable to use a Filter Query in a Get items action

I have tried to filter by a date field and by a choice field, but they both result in an invalid expression error.

 

For the date field, I write: ExpiryDate le addDays(utcNow('yyyy-MM-dd'),10,'yyyy-MM-dd')

 

and I get: The expression "ExpiryDate le 2018-06-22" is not valid. clientRequestId: 32c616f1-365e-4b8d-b0e7-1913c661f5b5 serviceRequestId: f766709e-8023-5000-d589-a40ee4e3f486

 

which shows that addDays(utcNow... is working. And ExpiryDate is a date field set to Date Only.

 

For filtering on a choice, I write: AccountStatus = 'Active'

 

and the error is: The expression "AccountStatus = 'Active'" is not valid. clientRequestId: 86b5f33a-6e81-4529-9de3-e74b57dc951f serviceRequestId: 4168709e-90db-5000-e4ca-2f66fd17f8b8

 

In the end, I need to have a compound conditions that ANDs these two together. But first, I would like to have them work separately. For now, I have almost 1,000 rows in my list, but it will double before too long and double again before it is mature.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: SharePoint/Flow: Unable to use a Filter Query in a Get items action

 Hi @RKushner,

 

For the date filed, I assume that you didn’t add a single quote around the function adddays in the Filter Query filed. Please configure the code under Expression tab then add a single quote around the code. Please take the following screenshot for a reference:

1.PNG

 

 

For the AccountChoice field, the code used in the Filter Query filed should be

AccountChoice eq 'Inactive'

 

And if you want to combine the two code together, please use the following code:

ExpiryDate le addDays(utcNow('yyyy-MM-dd'),10,'yyyy-MM-dd') and AccountChoice eq 'Inactive'

2.PNG

 

This doc about Filter expressions in Odata URLs could be helpful for you:

https://docs.microsoft.com/en-us/previous-versions/dynamicsnav-2016/hh169248(v=nav.90)

 

 

 

Best regards,

Mabel Mao

 

 

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

View solution in original post

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: SharePoint/Flow: Unable to use a Filter Query in a Get items action

 Hi @RKushner,

 

For the date filed, I assume that you didn’t add a single quote around the function adddays in the Filter Query filed. Please configure the code under Expression tab then add a single quote around the code. Please take the following screenshot for a reference:

1.PNG

 

 

For the AccountChoice field, the code used in the Filter Query filed should be

AccountChoice eq 'Inactive'

 

And if you want to combine the two code together, please use the following code:

ExpiryDate le addDays(utcNow('yyyy-MM-dd'),10,'yyyy-MM-dd') and AccountChoice eq 'Inactive'

2.PNG

 

This doc about Filter expressions in Odata URLs could be helpful for you:

https://docs.microsoft.com/en-us/previous-versions/dynamicsnav-2016/hh169248(v=nav.90)

 

 

 

Best regards,

Mabel Mao

 

 

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

View solution in original post

Highlighted
Advocate III
Advocate III

Re: SharePoint/Flow: Unable to use a Filter Query in a Get items action

For the date field, that works!!! 

 

But for the Account choice field, that is what I am already doing, and it doesn't work:

 

I write: AccountStatus = 'Active'

 

and the error is: The expression "AccountStatus = 'Active'" is not valid. clientRequestId: 86b5f33a-6e81-4529-9de3-e74b57dc951f serviceRequestId: 4168709e-90db-5000-e4ca-2f66fd17f8b8

 

I think that there is a special syntax for choice fields in conditions...

Highlighted
Advocate III
Advocate III

Re: SharePoint/Flow: Unable to use a Filter Query in a Get items action

I am confused because even though AccountStatus = 'Active' doesn't work, putting the two conditions together (like you said, ExpiryDate le 'addDays(utcNow('yyyy-MM-dd'),10,'yyyy-MM-dd')' and AccountChoice eq 'Inactive') does work!!!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (4,540)