cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
SSimmo
Level: Powered On

"Invalid Template" error on a less than date condition

I am just starting out with Flow and have created a flow which checks a column of a Sharepoint Online Document library for a Termination Date of an employee. If this date is older than 40 days, a few different tasks will be triggered opn those files.

The flow successfully recognises that some files are older than the 40 days and successfully sends an email (first task created to test). 

Despite this, the flow always says it has failed with the following:flowerror.PNG

 

 

 

 

 

 

This is a section of the flow that is being affected, with the expression being:

addDays(utcnow(),-40)

TermDateFLow.PNG

Any idea why this keeps giving me a failed response each time, whilst successfully sending me an email for the files in there older than 40 days?

Thanks, Simmo

1 ACCEPTED SOLUTION

Accepted Solutions
SSimmo
Level: Powered On

Re: "Invalid Template" error on a less than date condition

Something funky was going on.

I was looking in the body as you suggested, but it only showed that Termination_Date did not exist.

I have since had time to create a new column and now that part is working as expected. Not sure what happened there, but it seems to have baulked after the column name was changed.

THanks for you help though guys.

10 REPLIES 10
Super User
Super User

Re: "Invalid Template" error on a less than date condition

Are there any items in the column for termination date which are empty? If so it will throw an error. Either add a filter query  for termination date ne null or add a condition that if termination date is not null (which is set in the expression tab on the right) then do the following actions....

Rob
Los Gallardos

Super User
Super User

Re: "Invalid Template" error on a less than date condition

Hi @SSimmo , thank you for your post.

The error says "expects two parameters of matching types. The function was invoked with values of type 'Null' and 'string' that do not match"

Here is a link to the function reference for less (is less than in your condition builder)  to help illustrate the potential issue. - https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#l...

less

Check whether the first value is less than the second value. Return true when the first value is less, or return false when the first value is more.

less(<value>, <compareTo>)
less('<value>', '<compareTo>')
Parameter Required Type Description
<value> Yes Integer, Float, or String The first value to check whether less than the second value
<compareTo> Yes Integer, Float, or String, respectively The comparison item

 

Is it possible that some of your "Termination Date" values are null in the SharePoint List? If so, a filter query could be used to make sure you only pull back values that are not null and even filter on older than 40 days too.

 

Some information at this link may help.

 

Alternatively, you may have to look at making sure both values match and are string values or pehaps both are int values.

links to each below just in case but start with the nulls and filter if relevant:

int()

string()

 

If you have found my post helpful, please mark thumbs up.

Any other questions, just ask.

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


SSimmo
Level: Powered On

Re: "Invalid Template" error on a less than date condition

Thanks @AlanPs1 @RobElliott  for taking the time to respond.

I am a little confused though.

I have set the Filter Query to : Termination_Date ne null

FilterQuery.PNG

I can see the column in the sites Documents:

Termination_Date_Column_Lives.PNG

When I test, I get an error saying the Column does not exist.

ColumnDoesNotExist.PNG

What am I doing wrong?

Super User
Super User

Re: "Invalid Template" error on a less than date condition

Sorry I should have been clearer: don't just type null, you need to select it from the expressions tab over on the right. But it's puzzling that it's not finding your termination_date column. Not sure about that at the moment.

Rob
Los Gallardos

Super User
Super User

Re: "Invalid Template" error on a less than date condition

Hi @SSimmo 

How have you gotten on please?

Regards not recognising termination date. If you go to a successful or failed run and look at the output of your "Get item(s)". The body should show the exact name of "Termination_date".

It may be that it is more like the following format:Capture-401.png

It could be the column was renamed and the SharePoint List entity value has a name more like "Termiantion_x00200_date" but you will see that if you follow the instructions above.

Please let @RobElliott and I know how you get on and I'm sure either of us will pop back in and assist once we have clarified the exact entity name of the field called "Termination_date".

 

If you have found my post helpful, please mark thumbs up.

Any other questions, just ask.

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


SSimmo
Level: Powered On

Re: "Invalid Template" error on a less than date condition

Thanks @AlanPs1  and @RobElliott for the reply, apologies I have no replied sooner, I am on a course this week.

All the body says is:

{
"status": 400,
"message": "Column 'Termination_Date' does not exist. It may have been deleted by another user.\r\nclientRequestId: Long number in here\r\nserviceRequestId: Long number in here"
}
 
I did at one point change the column name from "Termination Date" to "Termination_Date" to test if the space might have been the problem. I did also put it back at one point also. Neither have obviously helped.
Maybe I will create another column with another name and setup a new flow with that name, see if that works.
Super User
Super User

Re: "Invalid Template" error on a less than date condition

Hi ... it’s like that x0020 represents your space. But if you check the output of get items in way described above you should be able to clarify that and rectify your flow.

Thanks, Alan

Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


SSimmo
Level: Powered On

Re: "Invalid Template" error on a less than date condition

Something funky was going on.

I was looking in the body as you suggested, but it only showed that Termination_Date did not exist.

I have since had time to create a new column and now that part is working as expected. Not sure what happened there, but it seems to have baulked after the column name was changed.

THanks for you help though guys.

SSimmo
Level: Powered On

Re: "Invalid Template" error on a less than date condition

Something funky was going on.

I was looking in the body as you suggested, but it only showed that Termination_Date did not exist.

I have since had time to create a new column and now that part is working as expected. Not sure what happened there, but it seems to have baulked after the column name was changed.

THanks for you help though guys.

Super User
Super User

Re: "Invalid Template" error on a less than date condition

Glad you have it working! Well done you for persevering!

Thanks, Alan

Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Helpful resources

Announcements
firstImage

Microsoft Flow Online Conference

Join us for a FULL day of FREE Microsoft Flow Sessions from some of the best minds in the industry!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

thirdImage

New Flow Community Board!

Check out the new Microsoft Flow Community Blog Topic Suggestion board!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 47 members 4,300 guests
Recent signins:
Please welcome our newest community members: