cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nours74
Helper II
Helper II

Error with apply to each "Unable to process template language expressions"

Hi,

 

I'm requesting help because I'm facing a strange issue.

I'm using a scheduled flow that runs each month.

 

This flow does :

- Gets lists of a special sharepoint site.

- Get Items of each list.

- Condition requires that a date from a column in the list is less than a calculated future date in the flow + the date is greater than today + one field countains "Do not remind".

 

If those conditions are matched, then an email is sent, this is flow is to check warranties expiration, and if a warranty is about to expire wihtin the next 60 days, then it sends an email.

 

The flow works perfectly when doing it on one specific list, if I then add the Get Lists, to apply to each list, then it doesnt work anymore.

More strange, if I remove the last condition about a field that countains "do not block". it works also.

 

I got this error when it fails :

InvalidTemplate. Unable to process template language expressions for action 'Condition_2' at line '1' and column '16387': 'The template language function 'less' expects two parameter of matching types. The function was invoked with values of type 'Null' and 'String' that do not match.'.

 

error.png

 

The only condition about "less" is for the date, I dont know why is he talking about that because when I run this in one list it works fine.

 

 

need.png

 

 

One last thing : When I changed it to apply to all lists I have lost all the dynamic fields that was gotten from the list, so for the conditions and my email I had to write them manually, like this :

items('Apply_to_each_2')?['Date_x0020xxxx']

 

All the 3 fields of the conditons are taken from the apply to each 2 step.

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
yashag2255
Dual Super User II
Dual Super User II

Hi @Nours74 

 

In that case can you confirm that the last condition where you are checking the choice type value that the column selected at the left side is items('Apply_to_each_2')?['Bloquer_x0020_Relance']?['Value']

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

6 REPLIES 6
yashag2255
Dual Super User II
Dual Super User II

Hi @Nours74 

 

Based on the error notification, one of the three columns you are passing in the condition are returning a null value. Can you add a compose action before the condition action and get all the column values over there and see what is being returned? 

 

Lastly, in the last condition, if the text is at the beginning or at the end, can you change the operand to starts with or ends with and try once? I guess contains does not work with string type data. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Hi, thanks for your reply.

 

I've already tryed using "start with" and "end with", its the same.

I forgot to mention that this field isnt a text field but a choice list.

 

I have check the get items report of the failed run to see how looks all the informations :

    "Bloquer_x0020_Relance": {
      "@odata.type""#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
      "Id"0,
      "Value""Ne pas bloquer"
    },
 
So I guess that the value is correct, so I dont know why it doesnt process the conditions.

I was thinking about something...

Because I'm writing manually the expression, maybe its different in the case of a choice list item.

Because If I had the dynamic expression of a choice list it would be "xxx Value".

 

Maybe I'm writting this manually wrong ?

 

I write : items('Apply_to_each')?['Bloquer_x0020_Relance']

 

Maybe its different to match a Value of a choice list ?

yashag2255
Dual Super User II
Dual Super User II

Hi @Nours74 

 

In that case can you confirm that the last condition where you are checking the choice type value that the column selected at the left side is items('Apply_to_each_2')?['Bloquer_x0020_Relance']?['Value']

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Indeed it was that... I had changed this field to a choice value and forgot to change the expression...

 

Thanks for your help 🙂

@yashag2255 Thank you for your answers!

Thank you for always participating in the forum.

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power Automate User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (44,852)