cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
toddmichaelryan
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
v-yamao-msft
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

GabrielStJohn
Microsoft
Microsoft

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



View solution in original post

5 REPLIES 5
v-yamao-msft
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

GabrielStJohn
Microsoft
Microsoft

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



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.

PlantBasedCajun
Helper I
Helper I

I am trying this but the Condition Action no longer allows for edit in Advanced Mode. 

Xnip2021-02-28_04-19-30.png

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,949)