cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jamesantony
Advocate I
Advocate I

Need Help with date comparison

Hi there,

 

I am creating an app to capture service anniversary dates in Sharepoint.

In Flow I have a scheduler that runs every day 00:00 and it should pick the service date in each record and compare it with current date. if it matches then it should send an email.

 

Sounds simple and I am fairly new to Flow so struggling a lot. Please help.

 

I tried with this - but it says the format is wrong. and I dont know if I need the apply to each or items etc. please shed some light experts.

 

@Equals(ticks(formatDateTime(items('Apply_to_each')?['Service_x0200_Date'])), ticks(utcnow())

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-zhos-msft
Solution Sage
Solution Sage

Hi @jamesantony ,

Are the service anniversary dates stored in the SharePoint list?

Here I have made a test on side, the dates are come from a list column.

The expression in the condition is:

formatDateTime(items('Apply_to_each')?['Service_x0020_date'],'yyyy-MM-dd')
is equal to
formatDateTime(utcNow(),'yyyy-MM-dd')

 

Capture2.PNG

Best Regards,

Community Support Team _ Zhongys

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

4 REPLIES 4
v-zhos-msft
Solution Sage
Solution Sage

Hi @jamesantony ,

Are the service anniversary dates stored in the SharePoint list?

Here I have made a test on side, the dates are come from a list column.

The expression in the condition is:

formatDateTime(items('Apply_to_each')?['Service_x0020_date'],'yyyy-MM-dd')
is equal to
formatDateTime(utcNow(),'yyyy-MM-dd')

 

Capture2.PNG

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-zhos-msft
Solution Sage
Solution Sage

Hi @jamesantony ,

Are the service anniversary dates stored in the SharePoint list?

Here I have made a test on side, the dates are come from a list column.

The expression in the condition is:

formatDateTime(items('Apply_to_each')?['Service_x0020_date'],'yyyy-MM-dd')
is equal to
formatDateTime(utcNow(),'yyyy-MM-dd')

 

Capture2.PNG

Best Regards,

Community Support Team _ Zhongys

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

@v-zhos-msft 

 

For the life of me I cannot get this to work.  I get the below error.  I'm assuming here that 'Service_x0020_date' is the name of the column?  My column name is 'Show Date' and it keeps erroring out.  

 

Unable to process template language expressions for action 'Condition' at line '1' and column '28207': 'The template language function 'formatDateTime' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#formatdatetime for usage details.'.

 

Any help is appreciated. 

 

Kevin Wolf

Anonymous
Not applicable

For me, this is matching on all rows, not just the two that have today's date.

 

@equals(formatDateTime(items('Apply_to_each')?['DueDate'], 'yyyy-MM-dd'), formatDateTime(utcNow(),'yyyy-MM-dd'))

 

JSullivan_0-1618434039536.png

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,969)