cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RedK
New Member

The template validation failed(..)

I get this message in a Flow:

 

The template validation failed: 'The template action 'Condition' at line '1' and column '1668' is not valid: "Unable to parse template language expression 'contains(body('Create_item')?['Subject'], ''1332'')': expected token 'RightParenthesis' and actual 'Integer'.".'.

 

The idea is that when a new email arrives it creates an item in a SharePoint list. The Subject of the email gets copied into the a list item. Then it is going to send an email. But only if the subject does not contain '1332'.  So I made a condition. See image below. Does anyone have any idea what might be wrong?

 

Capture.JPG

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-monli-msft
Community Support
Community Support

 

Hi RedK,

 

Please change the condition to the following and test if this one works.

1.PNG 

 

Regards,

Mona Li

 

Community Support Team _ Mona Li
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
v-monli-msft
Community Support
Community Support

 

Hi RedK,

 

Please change the condition to the following and test if this one works.

1.PNG 

 

Regards,

Mona Li

 

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

Thank you!

_nakul
Microsoft
Microsoft

There's another scenario where you might encounter similar error and that is when you are trying to use the item from the loop and initializing a variable based on the current item that you are looping through. In such case try using the item()['<field name>'] expression than the outputs('<previous step name>')?['<output field name from the previous step>']. Hope this helps.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,886)