Press "Enter" to skip to content

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

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… in short your Flow is corrupt.

The quickest resolution we have found is to simply use the ‘Save As’ feature to save your corrupt Flow as new Flow, this process should fix the 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:

  • 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: https://flow.microsoft.com/en-us/blog/import-export-bap-packages/

We hope this helps solve your issue 🙂

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *