web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Template Language Func...
Power Automate
Answered

Template Language Function Error

(0) ShareShare
ReportReport
Posted on by 63
Hi
 
I have a flow that is used every night to check and updates ages in a sharepoint list if needed - it had worked in the past but the last two nights it has been failing.
 
The exact error is:
 
Action 'Compose_1' failed: Unable to process template language expressions in action 'Compose_1' inputs at line '0' and column '0': 'The template language function 'sub' expects its first parameter to be an integer or a decimal number. The provided value is of type 'String'. Please see https://aka.ms/logicexpressions#sub for usage details.'.
 
 
The Compose_1 is a function with this code:
formatNumber(sub(outputs('GetAge'),0.5),'0')
 
The GetAge which is referenced looks like this (field_2 is DOB):
div(div(sub(ticks(variables('Today')),ticks(item()?['field_2'])),864000000000),365.25)
 
 
 
Any ideas on what has caused the issue?
Categories:
I have the same question (0)
  • Suggested answer
    eetuRobo Profile Picture
    4,495 Super User 2026 Season 1 on at
    Can you check the GetAge result. Sounds like GetAge output is text and not number type.
    The error says that it received a string type when the Compose_1's sub function is expecting number value (integer or decimal).

    In old design you can see if the value is number then the font is green and if its text its black. Or press Show raw outputs and if its text then it has double quotes around the value and if its numeric value then its just the number without double quotes.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 639

#2
Valantis Profile Picture

Valantis 392

#3
11manish Profile Picture

11manish 350

Last 30 days Overall leaderboard