← Verse · A-to-Mind · Fix an automation
Power Automate "InvalidTemplate": why an expression fails and how to fix it
You see: InvalidTemplate ยท Unable to process template language expressions in action
What it means
An expression in one of the flow's actions could not be worked out. The input it points at is empty, missing or the wrong type, for example reading a field from an item that does not have it, or taking the first item of an empty list.
How to fix it
- Open the flow's run history, open the failed run and click the action marked with the red cross. The error names the action and the expression.
- Open the earlier action the expression reads from and look at its outputs: is the field there for this run, and is it text, a number or a list?
- Make the expression forgiving: read optional fields with the question-mark form, body('Get_item')?['Title'], and give empty values a fallback with coalesce(), for example coalesce(triggerBody()?['email'], '').
- Check lists before using them: use a Condition on length(body('List_rows')?['value']) greater than 0 before first(), or use a loop.
- Save, then resubmit the failed run from run history.
If it keeps coming back
If it fails only for certain runs, the trigger is sometimes sent without a field. Test with that run's data on the trigger and add the fallback there.
Still stuck? Ask Verse, free
Paste the error and what the automation does. Verse names the likely cause and the fix, in seconds, no account.
Ask Verse about this errorOr have it fixed: $25
One broken automation, diagnosed and repaired, with proof it runs again. Reply to the receipt with what stopped.
Get the One-Time FixThe One-Time Fix covers one workflow. What you send and what you get back.