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

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

lbell
Level: Powered On

Re: Why is this expression invalid?

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

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

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 Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 406 members 3,039 guests
Please welcome our newest community members: