Unable to process template language expressions in action inputs at line ‘0’ and column ‘0’ in Power Automate

In this tutorial, I will show you how to fix the error”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’.

Unable to process template language expressions in action inputs at line ‘0’ and column ‘0’ in Power Automate

Recently, I was working on a requirement to update a SharePoint list date and time column in Power Automate. Here, I have a few columns:

  • TravelStartDate – Datetime column
  • TravelDurationDays – Number column
  • TravelEndDate – Datetime column

We are required to add TravelDurationDays to the TravelStartDate and then update the TravelEndDate.

Example:

Suppose a user wants to add 5 days to the travel start date (02-11-2023); we need to calculate and update TravelEndDate as 07-11-2023.

So, I wrote the below formula in the compose action.

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

But when I ran the flow, it gave me an error like the screenshot below.

Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0'

Solution: the template language function ‘addDays’ expects its second parameter to be an integer. The provided value is of type ‘Float’.

The error was coming because the TravelDurationDays parameter values were taken as a type of ‘Float’. The adddays() function expects ‘TravelDurationDays’ should have to be in the form of an integer.

formatDateTime(addDays(triggerOutputs()?['body/StartDate'],triggerOutputs()?['body/DurationDays']),'dd-MM-yyyy')
the template language function 'addDays' expects its second parameter to be an integer

How to Fix:-

To fix the error, you need to convert the provided value from a type of ‘Float’ to an integer. For that, I have used the ‘int()’ function along with the adddays() function in formatting date and time values.

Now, values provided in ‘TravelDurationDays’ will be converted into integer values, and it will add days to the ‘TravelStartDate’.

formatDateTime(addDays(triggerOutputs()?['body/StartDate'],int(triggerOutputs()?['body/DurationDays'])),'dd-MM-yyyy')
Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0

After editing the expression, run the flow. Then, the flow will run successfully without any errors.

Solved Unable to process template language expressions in action 'Compose' flow action

Now, the value will get updated in the SharePoint list, as shown below.

Unable to process template language expressions in action 'Compose'
Unable to process template language expressions in action 'Compose' inputs

Conclusion

This is how to fix the error “unable to process template language expressions in action inputs at line ‘0’ and column ‘0’” or “The template language function ‘addDays’ expects its second parameter to be an integer. The provided value is of type ‘Float” that comes in Power Automate.

You may like the following tutorials:

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…