Fix “Unable to Process Template Language Expressions” in Power Automate

If you build flows in Power Automate for long enough, you’ll meet this error. It usually appears on a flow that worked perfectly in testing, runs fine for a few days, and then suddenly fails on one particular item:

Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language function 'addDays' expects its second parameter to be an integer. The provided value is of type 'Float'.'

The first half of the message sounds alarming, but it’s the same for every version of this error. The part that matters comes after the colon: it names the function that failed and the kind of value it received. Once you know how to read that, the fix is usually one small change to an expression.

Quick answer: An expression in the action received a value of the wrong type, or no value at all (null). Read the text after the colon to see which function failed and what it received. Then convert the value with int(), float() or string(), handle empty values with if(empty(...)), coalesce() or the ? operator, or pick a single item from an array with first().

In this tutorial, I’ll show you how to read the error, and then walk through the eight versions of it I see most often, each with the expression I use to fix it.

How to read the error message

Every version of this error follows the same pattern. It starts with Action ‘X’, which tells you which action failed, such as a Compose, a Condition or a Send an email (V2) action.

Then comes inputs at line ‘0’ and column ‘0’, which is simply the position of the expression; in longer expressions you’ll see other numbers, such as line ‘1’ and column ‘26875’, but they mean the same thing. The useful part is the text after the colon, which describes the actual problem.

To investigate, open the failed run, select the red action and read its Error details. Then open that action in the designer and find the field that contains the expression. The table below matches the most common messages to their causes and fixes, and the sections that follow explain each one with an example.

The message saysWhat caused itHow to fix it
‘addDays’ expects its second parameter to be an integer. The provided value is of type ‘Float’A SharePoint Number column supplies a decimal numberaddDays(date, int(days))
‘int’ was invoked with a parameter that is not valid. The value cannot be converted to the target typeThe value is empty, has decimals (“3.5”) or contains textUse float() for decimals, or if(empty(x), 0, int(x))
‘contains’ expects its first argument ‘collection’ to be a dictionary (object), an array or a string. The provided value is of type ‘Null’The left side of a Condition is emptycoalesce(value, ''), or check for null first
‘greater’ expects two parameter of matching types … ‘String’ and ‘Integer’A text value is compared with a numbergreater(int(value), 0), or use float()
‘formatDateTime’ expects its first parameter to be of type string. The provided value is of type ‘Null’The date column is emptyif(empty(date), '', formatDateTime(date, 'yyyy-MM-dd'))
property ‘X’ doesn’t exist, available properties are …The item doesn’t have that propertyUse the ?['X'] operator
property ‘X’ cannot be selected. Array elements can only be selected using an integer indexYou selected a property on a list of itemsfirst(...)?['X'], or an Apply to each
The provided value is of type ‘Integer’ (or ‘Float’)A number was passed where text is expectedWrap the value in string()

Fix 1: addDays expects an integer but received a Float

I ran into this one in a travel request flow. The SharePoint list had a TravelStartDate date column, a TravelDurationDays number column and a TravelEndDate date column, and the flow was supposed to add the duration to the start date and fill in the end date. My first attempt used this expression:

formatDateTime(addDays(triggerOutputs()?['body/TravelStartDate'], triggerOutputs()?['body/TravelDurationDays']), 'yyyy-MM-dd')

The flow failed on the Compose action with the addDays error:

addDays expects its second parameter to be an integer error in Power Automate

The reason is that SharePoint Number columns arrive in a flow as decimal numbers, so 5 becomes 5.0, while addDays() only accepts a whole number. Wrapping the duration in int() fixes it:

formatDateTime(addDays(triggerOutputs()?['body/TravelStartDate'], int(triggerOutputs()?['body/TravelDurationDays'])), 'yyyy-MM-dd')
addDays with int() in a Power Automate Compose action

With that change, the flow runs successfully and writes the end date back to the list:

TravelEndDate updated in the SharePoint list

If your durations can include half days, such as 2.5, int() would drop the half. In that case, convert to hours instead with addHours(date, int(mul(float(days), 24))); note that addHours also needs a whole number, hence the int() around the multiplication.

Fix 2: int was invoked with a parameter that is not valid

The int() function converts text into a whole number (workflow expression functions reference). It fails whenever the text can’t be read as a whole number: when it’s empty, when it has a decimal part such as “3.5”, or when it isn’t a number at all, for example a Microsoft Forms answer of “N/A”.

How you fix it depends on the value. For decimals, use float() instead of int(). For values that may be empty, return a default before converting, for example if(empty(outputs('Get_response_details')?['body/r1']), 0, int(outputs('Get_response_details')?['body/r1'])). And when you’re not sure the value is a number at all, check it first with isInt() or isFloat(), which return true or false: if(isInt(variables('Qty')), int(variables('Qty')), 0).

Fix 3: Condition failed because ‘contains’ received a Null value

This is the version of the error people search for most often, and it shows up in a Condition rather than a Compose:

Action 'Condition' failed: Unable to process template language expressions for action 'Condition' at line '0' and column '0': 'The template language function 'contains' expects its first argument 'collection' to be a dictionary (object), an array or a string. The provided value is of type 'Null'.'

When you choose contains in a Condition, Power Automate runs the contains() function on the value in the left box. That value has to be text, an array or an object. When it’s empty, for example because a column wasn’t filled in or an answer is missing, the function receives null and the Condition fails.

The fix is to make sure the left side is never null. Replace the dynamic content in the left box with an expression that turns null into empty text:

coalesce(triggerOutputs()?['body/Comments'], '')

Another approach is to add an outer Condition that checks whether the value is not equal to null (enter null as an expression), and only run the contains check inside it. Microsoft suggests both approaches in this troubleshooting article. Keep in mind, too, that contains() is case-sensitive, so “Approved” doesn’t contain “approved”; wrap both sides in toLower() if case shouldn’t matter.

Fix 4: ‘greater’ expects two parameters of matching types

'The template language function 'greater' expects two parameter of matching types. The function was invoked with values of type 'String' and 'Integer' that do not match.'

Comparisons such as is greater than and is less than need the same type of value on both sides. The trouble is that values from Microsoft Forms, Excel and text columns always arrive as text, so the flow ends up comparing the text “10” with the number 5, and it refuses.

The fix is to convert the text side to a number: int() for whole numbers or float() for decimals. In a Condition, put the converted value as an expression in the left box and keep the number on the right:

greater(int(outputs('Get_response_details')?['body/r3']), 5)

If the value can be empty, guard it with if(empty(x), 0, float(x)). coalesce() won’t help here, because it doesn’t replace an empty string.

Fix 5: formatDateTime received a Null value

formatDateTime() needs a date as text, so it fails when the date column is empty. The simplest fix is to return an empty value when there’s no date, and format it only when there is one:

if(empty(triggerOutputs()?['body/DueDate']), '', formatDateTime(triggerOutputs()?['body/DueDate'], 'dd-MM-yyyy'))

Fix 6: The property doesn’t exist

The template language expression 'triggerBody()['Department']' cannot be evaluated because property 'Department' doesn't exist, available properties are '...'.

This means the item simply doesn’t contain that property, often because the column was empty or the trigger doesn’t return it. Adding a question mark before the property name, ?['Department'], tells Power Automate to return null instead of failing, and coalesce() can then supply a default:

coalesce(triggerBody()?['Department'], 'Not set')

It’s also worth checking the spelling. Expressions use a column’s internal name, which can differ from the name you see in the list, for example Department_x0020_Name.

Fix 7: Array elements can only be selected using an integer index

You’ll see this when you select a property on a list of items as if it were a single item, for example on the output of Get items or on a multi-select column. You have two options. Either process each item inside an Apply to each loop and use items('Apply_to_each')?['Title'], or, if you only need one item, pick it explicitly:

first(outputs('Get_items')?['body/value'])?['Title']

Fix 8: The action you reference didn’t run

This one took me a while to spot the first time. In a leave-approval flow, the error appeared only when the CEO rejected a request. The email action in the If no branch used outputs('Update_item')?['body/Author/Email'], but the Update item action lived in the If yes branch, so on a rejection it never ran and had no output to read.

Unable to process template language expressions when an action in another branch did not run

The fix is to reference only actions that always run before that step, such as the trigger. In this flow, triggerOutputs()?['body/Author/Email'] works in both branches. You may read advice elsewhere to delete and re-add the Condition or save a copy of the flow; that sometimes appears to help, but only because it changes which action the expression points to.

How to find the failing expression quickly

When a flow has many expressions, finding the broken one can take longer than fixing it. This is the routine I follow:

  1. Open the failed run, select the red action, and copy the text after the colon in Error details.
  2. In the designer, open that action and look for fields that contain an fx expression. In a Condition, check both boxes of every row.
  3. Add a Compose action just before it that outputs the same value without any function around it. Run the flow again and look at the Compose output, which shows the actual value and its type.
  4. Apply the matching fix from the table above, then remove the temporary Compose.

These Power Automate expression guides go deeper into the functions used above:

For the full list of functions and the types they accept, see the workflow expression functions reference on Microsoft Learn. Power Automate uses the same expression language as Azure Logic Apps, so the reference applies to both.

Frequently Asked Questions

What does “Unable to process template language expressions” mean in Power Automate?

It means an expression in the action received a value it can’t use: either the wrong type, such as text instead of a number, or no value at all (null). The text after the colon names the function and the type it received.

How do I fix “The provided value is of type ‘Null’”?

Handle the empty value before the function runs: use coalesce(value, ”) to replace null with empty text, the ? operator for missing properties, or a Condition that checks the value is not equal to null.

How do I fix “addDays expects its second parameter to be an integer”?

Wrap the number in int(), for example addDays(date, int(days)). SharePoint Number columns arrive as decimal numbers, and addDays() only accepts whole numbers.

Why does my Condition fail with ‘contains’ and type ‘Null’?

The value on the left side of the Condition is empty. Replace it with coalesce(value, ”) or check that it is not null in an outer Condition first.

Why doesn’t coalesce() fix an empty text value?

coalesce() only replaces null. An empty string isn’t null, so use if(empty(value), default, value) when a field can be blank.

What do “line ‘0’ and column ‘0’” mean in the error?

They show where the failing part starts inside the expression. The numbers change with longer expressions, but the fix depends only on the text after the colon.