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

Help Creating an Automated Planner Report

I'm trying to have a weekly email that contains the tasks completed the week previous.  Seems simple but I'm getting stuck comparing the "completedDateTime" with the current date. All help is appreciated. 

 

'@greaterOrEquals(item()?['completedDateTime'], addDays(utcNow('yyyy-MM-dd'), int(-7), 'yyyy-MM-dd'))'

 

The execution of template action 'Filter_array_2' failed: The evaluation of 'query' action 'where' expression '@greaterOrEquals(item()?['completedDateTime'], addDays(utcNow('yyyy-MM-dd'), int(-7), 'yyyy-MM-dd'))' failed: 'The template language function 'greaterOrEquals' expects two parameter of matching types. The function was invoked with values of type 'Null' and 'String' that do not match.'.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support Team
Community Support Team

Re: Help Creating an Automated Planner Report

Hi @toddmichaelryan,

 

To compare between two days, the two dates should be in the same format. Usually we use function formateDateTime to format date. To add a number of days to a timestamp, we use adddays function.

 

More details about the date and time function, please check the following doc:

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#d...

 

About your scenario, please try the following code to see if it will work for you:

@greaterorequals(formatdateTime(items('Apply_to_each')?['completedDateTime'], 'yyyy-MM-dd'),formatDateTime(adddays(utcnow(),-7),'yyyy-MM-dd'))

 

The flow is created likes below and it works fine.

1.PNG 

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Administrator
Administrator

Re: Help Creating an Automated Planner Report

Hello, @toddmichaelryan!

 

Thank you for posting on the Flow Community Forum! Have you had an opportunity to apply @v-yamao-msft‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!


Thank you for being an active member of the Flow Community!

 

-Gabriel
Flow Community Manager

-Gabriel
Microsoft Power Automate Community Manager
Are YOU a member of your local Power Automate User Group?
Fill out This Form to claim your Community User Group Member Badge!

View solution in original post

3 REPLIES 3
Community Support Team
Community Support Team

Re: Help Creating an Automated Planner Report

Hi @toddmichaelryan,

 

To compare between two days, the two dates should be in the same format. Usually we use function formateDateTime to format date. To add a number of days to a timestamp, we use adddays function.

 

More details about the date and time function, please check the following doc:

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#d...

 

About your scenario, please try the following code to see if it will work for you:

@greaterorequals(formatdateTime(items('Apply_to_each')?['completedDateTime'], 'yyyy-MM-dd'),formatDateTime(adddays(utcnow(),-7),'yyyy-MM-dd'))

 

The flow is created likes below and it works fine.

1.PNG 

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Administrator
Administrator

Re: Help Creating an Automated Planner Report

Hello, @toddmichaelryan!

 

Thank you for posting on the Flow Community Forum! Have you had an opportunity to apply @v-yamao-msft‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!


Thank you for being an active member of the Flow Community!

 

-Gabriel
Flow Community Manager

-Gabriel
Microsoft Power Automate Community Manager
Are YOU a member of your local Power Automate User Group?
Fill out This Form to claim your Community User Group Member Badge!

View solution in original post

MarshallMallow
Level: Powered On

Re: Help Creating an Automated Planner Report

How could you apply this to a specific date collumn in an Excel Spreadsheet?

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 (6,779)