cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Community Support
Community Support

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

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
Community Manager
Power Automate | Power Virtual Agents
Super User Program Manager
Power Platform Communities

View solution in original post

4 REPLIES 4
Community Support
Community Support

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

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
Community Manager
Power Automate | Power Virtual Agents
Super User Program Manager
Power Platform Communities

View solution in original post

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

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
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (7,629)