Fix the "InvalidTemplate. Unable to process template language expressions in action" error in Power Automate

September 11th 2019

Want to fix the InvalidTemplate error in Power Automate? Yeah, we’re not surprised!

We receive more support calls than we’d like where the following error is generated running a Flow instance: InvalidTemplate. Unable to process template language expressions in action

Some example errors are detailed below:

InvalidTemplate. Unable to process template language expressions in action 'Convert_HTML_to_PDF' inputs at line '1' and column '2622': 'The template language expression 'json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$connections']['shared_encodiandocumentmanager']['connectionId']' cannot be evaluated because property 'shared_encodiandocumentmanager' doesn't exist, available properties are 'shared_onedriveforbusiness, shared_sharepointonline_2'. Please see https://aka.ms/logicexpressions for usage details.

InvalidTemplate. Unable to process template language expressions in action 'Merge_Word_Documents' inputs at line '1' and column '2722': 'The template language expression 'json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$connections']['shared_encodiandocumentmanager_1']['connectionId']' cannot be evaluated because property 'shared_encodiandocumentmanager_1' doesn't exist, available properties are 'shared_sharepointonline, shared_approvals, shared_office365, shared_wordonlinebusiness'. Please see https://aka.ms/logicexpressions for usage details.

But note this error is not specific to the Encodian connector, it affects all connectors in Power Automate:

InvalidTemplate

This error is not caused by an issue with the action or the configuration of the action… and there are two super quick approaches to resolve:

Option 1 – remove InvalidTemplate with ‘Use new Test Data’

This issue typically occurs whilst you are building flow solutions and is typically caused by re-using previous run data. Just simply try using new data to test your flow!

InvalidTemplate

If this quick fix doesn’t work, try option 2.

Option 2 – ‘Save As’ a new Flow

Use the ‘Save As’ feature to save your corrupt Flow as a new Flow, this process should fix any broken connections.

InvalidTemplate

If this issue is affecting a PowerApp connected Flow then you may wish to simply disassociate and then re-associate the Flow which typically fixes the issue without needed to create a new flow using the ‘Save As‘ feature.

If you’re still having issues you may also try the following:

  • Close your browser session, re-open the Flow in a new session and re-run the Flow.
  • Remove the offending action and connection, re-add your action and repeat step #1
  • Export and then re-import your Flow.

If you’re unsure how to export / import Flows please refer to the following guidance on Microsoft’s website.

We hope this helps you fix the InvalidTemplate error in Power Automate 🙂

UPDATE: We’re excited to announce some significant updates to Flowr for Power Automate! As of October 2024, we’ve improved by updating action names and splitting Flowr’s central Power Automate connector into nine specialized connectors. These changes will make your workflow faster, smoother, and more efficient. The new action names are more precise and intuitive, saving you time, while the focused connectors enhance performance and flexibility. This update also helps future-proof the platform for even more powerful features. Check out our updated action names blog.

Author
Jay Goodison

Managing Director

You might also be interested in...