cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
shaneOZ
Level 8

build a flow to check a range of dates from a sharepoint list date column and create new list item (Im stuck pictures inside)

Hi,

 

Here is my flow 

for forum1.pngfor forum2.png

 

The expression configured inside single quotes:

addDays(utcNow(),1)
addDays(utcNow(),30)

 

the error im getting is

 

 

for forum3.png

 

The full error message is -(a little bit of identifying info)

{
  "status": 400,
  "message": "The expression \"DueDate\r ge '2019-10-15T10:19:02.3969724Z'\nDueDate\r le ''2019-11-13T10:19:02.3969724Z\" is not valid.\r\nclientRequestId: 48286b9f-2f2f-47dc-ae06-a7f75f770f81\r\nserviceRequestId: 48286b9f-2f2f-47dc-ae06-a7f75f770f81"
}

I just wish to build a flow that creates a new item in another list if the duedate is between the range of date. Any help would be appreciated

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: build a flow to check a range of dates from a sharepoint list date column and create new list item (Im stuck pictures inside)

I mean the word and in lowercase letters.  The filter you are looking to implement is that a date is greater than this date and less than this date.  You have to present the filter as a single query.  Also, in looking back at your screenshot, double check the location of the ' (single quotes) around your datetime formulas.  The second one seems to be misplaced.  Here's an example of one that works for me.

screenshot.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

6 REPLIES 6
Dual Super User
Dual Super User

Re: build a flow to check a range of dates from a sharepoint list date column and create new list item (Im stuck pictures inside)

Try adding an 'And' between your two query settings. You can only submit one query filter on a Get items and you are trying to input two query strings.  



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
shaneOZ
Level 8

Re: build a flow to check a range of dates from a sharepoint list date column and create new list item (Im stuck pictures inside)

Can you,


@Pstork1 wrote:

Try adding an 'And' between your two query settings. You can only submit one query filter on a Get items and you are trying to input two query strings.  


Can you break this down a little more?


Try adding an 'And' between your two query settings.

 

You mean the word 'And" or the , or ; & ? sorry if im sounding daft. Its probably something simple right in front of me that im just not seeing, ive been on this problem for the last 16hours.

Dual Super User
Dual Super User

Re: build a flow to check a range of dates from a sharepoint list date column and create new list item (Im stuck pictures inside)

I mean the word and in lowercase letters.  The filter you are looking to implement is that a date is greater than this date and less than this date.  You have to present the filter as a single query.  Also, in looking back at your screenshot, double check the location of the ' (single quotes) around your datetime formulas.  The second one seems to be misplaced.  Here's an example of one that works for me.

screenshot.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

shaneOZ
Level 8

Re: build a flow to check a range of dates from a sharepoint list date column and create new list item (Im stuck pictures inside)


@Pstork1 wrote:

I mean the word and in lowercase letters.  The filter you are looking to implement is that a date is greater than this date and less than this date.  You have to present the filter as a single query.  Also, in looking back at your screenshot, double check the location of the ' (single quotes) around your datetime formulas.  The second one seems to be misplaced.  Here's an example of one that works for me.

screenshot.png


 

DueDate
 ge '@{addDays(utcNow(),1)}' and
DueDate
 le '@{addDays(utcNow(),30)}'

 

 

gives me the exact same error

 

{
  "status": 400,
  "message": "The expression \"DueDate\r ge '2019-10-15T13:19:22.2547901Z' and\nDueDate\r le '2019-11-13T13:19:22.2547901Z'\" is not valid.\r\nclientRequestId: 7a929901-73ab-4828-86c8-386296912f70\r\nserviceRequestId: 7a929901-73ab-4828-86c8-386296912f70"
}

The whole amount of my google searching and expiermenting the last two days is saying this should work.. im starting to think its a date code issue, curiously can run that test flow above and screenshot the sucess of the date columns? im in Aus and i take it you in US? id yours doesnt show the time stamp on the success? ge '2019-10-15T13:19:22.2547901Z'

 
Dual Super User
Dual Super User

Re: build a flow to check a range of dates from a sharepoint list date column and create new list item (Im stuck pictures inside)

First thing I would try is to remove the carriage returns from your filter (the \r that shows in the error message.)  Also, make sure there is a space between the 'and' and the second DueDate AS you can see mine is all on one line (the \n that shows in the error message.)

 

Here's what my query looks like in the successful run.

TestDate  le '2019-11-13T12:29:12.7872344Z' and TestDate ge '2019-07-31T12:29:12.7872344Z'

Yours looks like this

DueDate\r ge '2019-10-15T13:19:22.2547901Z' and\nDueDate\r le '2019-11-13T13:19:22.2547901Z'

As you can see it automatically formats for UTC, rather than the US region.  So I don't think its a data time formatting issue.  I'm assuming that DueDate is a SharePoint datetime column right?

 

Other than that I don't see any differences.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Community Support Team
Community Support Team

Re: build a flow to check a range of dates from a sharepoint list date column and create new list item (Im stuck pictures inside)

Hi @shaneOZ ,

 

Could you please share a full screenshot of the configuration of your current flow?

Have you take a try with @Pstork1 's solution?

What is the full expession in the Filter Query field in the Get items action?

Please don't add extra text or space in the Filter Query field in the Get items action, also please take a try with @Pstork1 's solution and let me know if your problem could be solved.

1.png

 

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 (Last 30 Days)
Users online (5,831)