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:
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:
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!
If this quick fix doesn’t work, try option 2.
Use the âSave Asâ feature to save your corrupt Flow as a new Flow, this process should fix any broken connections.
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:
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 đ
Managing Director