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

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
Highlighted
Community Support
Community Support

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

Highlighted
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

4 REPLIES 4
Highlighted
Community Support
Community Support

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

Highlighted
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

Regular Visitor

Re: Help Creating an Automated Planner Report

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

Highlighted
New Member

Re: Help Creating an Automated Planner Report

I just had this error message, would love some help:

The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression 'va@{body('List_my_tasks_2')?['value']}' is of type 'String'. The result must be a valid array.

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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 (7,662)