cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
EmmanS
Level: Powered On

The expression "..." is not valid

Hi,

 

I am trying to use the Filter query of Get Items to filter if a list column's date input is ge than today and le today+30 days.

The Date's column name is "Due Date of Calibration" without quotes of course.

With that in mind, I believe the filter should go as follows:

filter.png

When testing the run, it errors out at this step with the error: "The expression "Due_x0020_Date_x0020_of_x0020_Calibration ge '2019-01-28T17:53:41.6062560Z' and Due_x0020_Date_x0020_of_x0020_Calibration le '" is not valid.
clientRequestId: 3cedc535-e765-4d74-af1f-5df4536a6b7b
serviceRequestId: 547cba9e-007c-7000-d819-5414f99bcd86" 

I have tried putting single quotes around the column name and that did not work either.

 

My current workaround is to have no filter query and just do a condition instead but I would like to know if there's a way to make this query work.

date.PNG

Any thoughts?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
v-zhos-msft
Level 10

Re: The expression "..." is not valid

Hi EmmanS,

I think the issue is that in flow, the Filter Query can’t identify the column name with spaces.

In MS Flow, when you use a Data Name with spaces, it will change to another code randomly.

First, you can make a test to get the value of the list to get code of Due Date of Calibration in flow.

I have made a same flow as yours below: As you can see, the name of Due Date of Calibration has Changed to fqeh.

Then used the fqeh in the filter Query, it works will.

The expression is: fqeh ge ’formatDateTime(utcNow(),'yyyy-MM-dd')’ and fqeh le ‘addDays(utcNow(),30,'yyyy-MM-dd')

1.png2.png3.png

Please feel free post back if you need more help.

Best regards,

Zhonys

View solution in original post

3 REPLIES 3
WDRC
Level: Powered On

Re: The expression "..." is not valid

@EmmanS

I have issues similar to you in filtering date columns in a SP list.  I cannot get it to work.

Regards,

Andrew

 

v-zhos-msft
Level 10

Re: The expression "..." is not valid

Hi EmmanS,

I think the issue is that in flow, the Filter Query can’t identify the column name with spaces.

In MS Flow, when you use a Data Name with spaces, it will change to another code randomly.

First, you can make a test to get the value of the list to get code of Due Date of Calibration in flow.

I have made a same flow as yours below: As you can see, the name of Due Date of Calibration has Changed to fqeh.

Then used the fqeh in the filter Query, it works will.

The expression is: fqeh ge ’formatDateTime(utcNow(),'yyyy-MM-dd')’ and fqeh le ‘addDays(utcNow(),30,'yyyy-MM-dd')

1.png2.png3.png

Please feel free post back if you need more help.

Best regards,

Zhonys

View solution in original post

Highlighted
EmmanS
Level: Powered On

Re: The expression "..." is not valid

Hi @v-zhos-msft,

 

Thanks for the help! I double checked the name and it looks like its "code" name has some character limits as per the screenshot below. I have tested the flow using the correct variable for the column and the query now works.

works.png

Thanks again for the help, appreciate it!

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 345 members 6,353 guests
Please welcome our newest community members: