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

3 REPLIES 3
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.

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

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

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!

Users online (20,101)