cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Why is this expression invalid?

formatDateTime(addDays(utcNow(),-35),'yyyy-mm-dd')
 
Trying to set up a reminder for a contract renewal 5 weeks (35 days) prior to expiration. Pulled from a sharepoint list.
 
This is the error message I receive. No idea why it has "49" as the month. The 17th could be 35 days prior to today, but I'm looking to pull dates that are 35 days in the future. 
 
"status": 400,
"message": "The expression \"PotentialStartDate eq ''2019-49-17\" is not valid.\r\nclientRequestId: 45524fa9-d94a-4cc1-90c9-6ad2b3fc050c\r\nserviceRequestId: 45524fa9-d94a-4cc1-90c9-6ad2b3fc050c"
}
 
Afraid I shouldn't have been using the "-" in front of the 35 (if the 17th is 35 days behind today, I'd want to pull a date 35 days in the future? Maybe?), I gave that a try.
This is the error message I receive when I use: formatDateTime(addDays(utcNow(),35),'yyyy-mm-dd') 
(Removed the "-" from in front of the 35.)
 
"status": 400,
"message": "The expression \"PotentialStartDate eq ''2019-54-26\" is not valid.\r\nclientRequestId: 612a2c10-e71c-4b8a-a1f8-45563eb3dc8f\r\nserviceRequestId: 612a2c10-e71c-4b8a-a1f8-45563eb3dc8f"
}
 
Now they're looking for the 54th month? I'm beyond confused. Followed every detial of a YouTube video from a gentleman who it seemed to work for, so I have no idea what I'm doing incorrectly. I'm definitely not a professional, and know nothing about coding. Honestly (and maybe naively), I didn't think you had to know all of that to use Flow, but I'm coming across a great deal more errors than I had anticipated.
 
I've been working on it all afternoon, so maybe my eyes are missing something obvious. Any help would be greatly appreciated. 
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Why is this expression invalid?

@lbell 

mm is the minutes.  Try MM (uppercase) for month.  Not totally related, but I just wrote something which includes a primer on dates in ISO format here.

 

 

-Ed-

 

 

If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

View solution in original post

2 REPLIES 2
Highlighted
Super User
Super User

Re: Why is this expression invalid?

@lbell 

mm is the minutes.  Try MM (uppercase) for month.  Not totally related, but I just wrote something which includes a primer on dates in ISO format here.

 

 

-Ed-

 

 

If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

View solution in original post

Highlighted
Regular Visitor

Re: Why is this expression invalid?

Who knew it would be that simple... Thank you, @edgonzales!

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Top Kudoed Authors
Users online (8,352)