cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tsprague
New Member

Cannot get past error messages!

Hi all!

 

The summary of my overall project is that I am trying to set something up where employees can submit their weekly updates to a Microsoft Form, and then a summary of all the form responses would be emailed out to the team each Friday morning. 

 

So far, I've connected the form to a Sharepoint list so that when a response is submitted it gets added to the list.

 

I am extremely stuck with getting the summary email sent out that. Specifically, when I try to use the Filter Query to get only the items from the last 7 days sent. I have scoured the web for solutions but no matter what, a new error message always comes up.

 

Right now, I am trying to use:

TimeStamp gt 'adddays(utcnow(),-7, 'yyyy-MM-dd')'

 

But I get this message:

The expression "TimeStamp gt 'adddays(utcnow(),-7, 'yyyy-MM-dd')'" is not valid. Creating query failed.
clientRequestId: 3b5e521e-435f-4b67-9ae4-c4f1b5ce5360
serviceRequestId: 3b5e521e-435f-4b67-9ae4-c4f1b5ce5360

 

If I remove the single quotes around the whole thing so that it is:

TimeStamp gt adddays(utcnow(),-7, 'yyyy-MM-dd')

 

I get:

The query is not valid.
clientRequestId: 12f8bdfd-2992-4cd3-af16-d17253b761dc
serviceRequestId: 12f8bdfd-2992-4cd3-af16-d17253b761dc

 

I've checked and am confident that the name of the column is correct. I feel like no matter what I try it simply isn't working though I've seen so many people find their solutions. I admit that I am very much new to Power Automate so any help and handholding you can offer would be great! 

 

EDIT: 

Editing to add that I just used the Expression tool to add it instead of having it as just raw text, which made the error become: The expression "TimeStamp gt 2021-08-13" is not valid. Creating query failed.
clientRequestId: dfde887b-f0f0-4977-b87a-dfb55fb64809
serviceRequestId: dfde887b-f0f0-4977-b87a-dfb55fb64809

 

The date being populated feels like a sign of improvement.....but it still isn't working. I added a second image to show this change. 

 

Screenshot 2021-08-20 160603.png

UPDATED:

Updated.png

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

Look closely at the image I posted in my earlier reply.  I've posted it again in this reply. You need to have single quotes around the date that is generated by the AddDays() function.  But you have to add them directly, not inside the Expression editor.  The single quotes around 'yyyy-MM-dd' inside the function is just to designate the format.  They don't come through in the value.

image.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

11 REPLIES 11
Pstork1
Dual Super User III
Dual Super User III

First, have you checked in a sample run without the query to make sure the column is included in the get items?  Since you aren't tying your get items to a specific view it is probably defaulting to All items and may not include that column.  Checking a run will also help you verify the column name.

 

Second, the Odata query definitely requires single quotes around the target date.

 

Third, you don't really need the format date.  Here's a screenshot of a similar one that is working for me.

image.png



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

It does seem to be pulling the column when the Query is removed, at least based on the Output. Removing the query made me see that my Flow is messed up in other places as well, so I probably need to address that as well. It seems like I should at least be able to surpass and get the all clear on the query if it were working properly before the steps that are wrong? The date formatting didn't seem to impact much as you said so I've removed that. 

Pstork1
Dual Super User III
Dual Super User III

It should work then the way your last attempt was written if you add the single quotes around the date that you create using AddDays()



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

Hi @Pstork1,

 

So that made some progress, but I am getting another error now. It says:

 

Unable to process template language expressions in action 'Get_items' inputs at line '1' and column '14722': 'The template language function 'addDays' expects a timestamp as the first parameter, the number of days to add as the second parameter, and an optional format string as the third parameter. The function was invoked with '1' parameter(s). Please see https://aka.ms/logicexpressions#adddays for usage details.'.

 

I tried following the website it referenced but that did not help. Any other recommendations? Below is the most recent version. 

 

tsprague_0-1629676720056.png

 

 

 

 

 

Pstork1
Dual Super User III
Dual Super User III

You've got extra single quotes in your formula.  The formula you type in the expressions tab should just be 

adddays(utcnow(),-7, 'yyyy-MM-dd')

 



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

Hi again @Pstork1 ,

 

That led me to this error now:

The expression "TimeStamp gt 2021-08-16" is not valid. Creating query failed.

 

Any thoughts?

Pstork1
Dual Super User III
Dual Super User III

As mentioned earlier you now left out the required single quotes around the date.   The result when you run the query should look like this.

TimeStamp gt '2021-08-16'

 



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

For reference, this is the query now:

tsprague_0-1629724583958.png

 

It seems to me they are around the date though? Where else would they go if not around the YYYY-MM-DD? Or is there somewhere else I am missing? Just not catching where the quotes should be in the expression to make sure they end up around the date. (The photo in my reference post below is my most recent attempt)

 

I'm sorry, and I greatly appreciate your help. This has been driving me wild and it means a lot to have your responses.

Pstork1
Dual Super User III
Dual Super User III

Look closely at the image I posted in my earlier reply.  I've posted it again in this reply. You need to have single quotes around the date that is generated by the AddDays() function.  But you have to add them directly, not inside the Expression editor.  The single quotes around 'yyyy-MM-dd' inside the function is just to designate the format.  They don't come through in the value.

image.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

THANK YOU! 

 

I feel so stupid that was extremely simple. Thank you for your patience and information!

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,588)