cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lbell
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
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
Regular Visitor

Re: Why is this expression invalid?

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

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: 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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (5,619)