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

"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
Highlighted
Frequent Visitor

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.

View solution in original post

10 REPLIES 10
Highlighted
Super User III
Super User III

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

Highlighted
Resident Rockstar
Resident Rockstar

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!


Highlighted
Frequent Visitor

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?

Highlighted
Super User III
Super User III

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

Highlighted
Resident Rockstar
Resident Rockstar

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!


Highlighted
Frequent Visitor

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.
Highlighted
Resident Rockstar
Resident Rockstar

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!


Highlighted
Frequent Visitor

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.

Highlighted
Frequent Visitor

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.

View solution in original post

Highlighted
Resident Rockstar
Resident Rockstar

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

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Top Kudoed Authors
Users online (8,391)