cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
422
Frequent Visitor

Compare column date from SahrePoint list to today's date

Hi, 

I am trying to compare dates from a sharepoint list with the current date. If the date has passed I want the item moved to an archive list. I keep getting the following error message. "InvalidTemplate. Unable to process template language expressions for action 'Condition' at line '1' and column '2555': 'The template language function 'greater' expects two parameter of matching types. The function was invoked with values of type 'Null' and 'String' that do not match.'." 

 

I have a scheduled flow that gets items from my original list. I then have it set to use the column "Date" and anything less then or equal to "formatDateTime(utcNow(),'yyyy-MM-dd')" is supposed to create a new item in the archive list.  

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

Hi @422 ,

 

Could you share the specific details of the Flow configuration?

It seems that the parameters configured in Condition do not meet the requirements.

I did a test on my side, please refer to the following method to configure Flow.

 

If you need to compare dates, you need to make sure that the date field is not empty. You could refer to the method provided by @efialttes , or you could use Condition to exclude null values.

Note that we need to put the condition that determines if the Date is empty on the first row.

 

Image reference:

4.PNG

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
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
efialttes
Super User
Super User

@422 

If you get a Null response from one of the columns, I guess this is because it is not mandatory to fill it when creating a new item.

In this post, @ScottShearer gave an excelent advice on how to deal with empty columns.

Hope this helps

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



v-bacao-msft
Community Support
Community Support

Hi @422 ,

 

Could you share the specific details of the Flow configuration?

It seems that the parameters configured in Condition do not meet the requirements.

I did a test on my side, please refer to the following method to configure Flow.

 

If you need to compare dates, you need to make sure that the date field is not empty. You could refer to the method provided by @efialttes , or you could use Condition to exclude null values.

Note that we need to put the condition that determines if the Date is empty on the first row.

 

Image reference:

4.PNG

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
422
Frequent Visitor

Thanks for the help! I have figured out the null issue. However even though I have dates that greater than todays date the condition is still coming out as true. For example the date that is being compared is 10/10/2019 but it is still passing. Is there something wrong with my function date that is allowing this? I reconfigued the date function to match the format of the column. So now it is "formatDateTime(utcNow(),'MM/dd/yyyy')". Please let me know if you have any ideas! 

 

On another note I have 144 items on my original SharePoint list but the flow is only testing 100.... I am so confused. 

Brett15
Regular Visitor

So I was running into the same issue. I was using "formatDateTime(utcNow(),'MM/dd/yyyy')" and my files that had a greater date kept passing. So I added another column in Sharepoint called "Disposition Check" I made that date equal to today. So in Power Automate you just add the condition to compare if your "Date" is less than your "Date Check." I added some screen shots below. Hope this helps!

 

 

date check.JPGSharepoint.JPG

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

PWREduCon768x460.png

Join us at PWR EduCon - A Power Platform Conference

Learn from the top Power BI, Power Apps, Power Automate & Power Virtual Agents experts!

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Users online (2,307)