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

Community site session details

Session Id : 5sXBhdMeET9L3JPKnKnCzR
Power Automate - General Discussion
Unanswered

Issue - The template language function 'sub' expects its second parameter to be an integer or a decimal number. The provided value is of type 'String'.

Like (0) ShareShare
ReportReport
Posted on 24 Dec 2020 11:33:21 by 1,119

Hi Guys,

 

Hope all are well and safe.

 

In my flow I am getting the following error, hope someone can help me πŸ˜Š

 

 

InvalidTemplate. Unable to process template language expressions in action 'Compose_-_calculate_difference_in_days' inputs at line '1' and column '13923': 'The template language function 'sub' expects its second 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.'.

 

 

This is the flow

 

Screenshot_20201224_113211.png

I have the same question (0)
  • jbrines Profile Picture
    1,119 on 28 Dec 2020 at 18:11:03
    Re: Issue - The template language function 'sub' expects its second parameter to be an integer or a decimal number. The provided value is of type 'String'.

    @RezaDorrani 

     

    Do you mean like the following?

     

    int(div(div(div(div(mul(sub(variables('ticksUTCNow'),variables('ticksCreated')),100),1000000000),60),60),24))

     

    Then it still fails.

     

  • RezaDorrani Profile Picture
    12,141 on 24 Dec 2020 at 16:22:13
    Re: Issue - The template language function 'sub' expects its second parameter to be an integer or a decimal number. The provided value is of type 'String'.

    Hi @jbrines 

     

    sub expects arguments of type int or decimal only.

    try typecasting your compose value as int(compose dynamic value)

     

    To learn more about expressions, check this video series : aka.ms/learnexpressions

     

    --------------------------------------------------------------------------------
    If this post helps answer your question, please click on β€œAccept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

    Thanks,
    Reza Dorrani, MVP
    YouTube
    Twitter

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 736 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 396 Moderator

#3
Power Apps 1919 Profile Picture

Power Apps 1919 339

Last 30 days Overall leaderboard