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 / Formatting the number ...
Power Automate
Answered

Formatting the number from a Compose action into a whole number

(0) ShareShare
ReportReport
Posted on by 509

Morning

 

I'm trying to get the numbers from two SharePoint fields to use in a subtraction expression.

 

The one field is coming in fine, but the other value is coming back as 2.0000000000 (see below) which is causing the expression to throw the following error: "Unable to process template language expressions in action 'Days_Remaining' inputs at line '1' and column '37863': 'The template language function 'sub' expects its second parameter to be an integer or a decimal number."

 

How do I format the output so that it returns a whole? I've just tried changing the number of decimal places on the SP field to 0 but it still comes back with 2.000000000000. all help appreciated.

number of days requested.png 

Categories:
  • Verified answer
    Jcook Profile Picture
    7,783 Most Valuable Professional on at

    Hello @darrenfloyd666 

     

    Please try the int() expression.

     

    This can be used inside the compose action. inside the ( ) put the dynamic value of the number.

  • sutekh Profile Picture
    509 on at

    Thanks @Jcook  

     

    The name of the Dynamic Value is 'Holiday_allocation'. If I type 'int( )' in the expression I can't see it in Dynamic Content only Body and Values, and if I just type 

    int(Holiday_allocation)

    in the expression field I'm getting the 'expression is invalid'. Where am I going wrong?

  • Jcook Profile Picture
    7,783 Most Valuable Professional on at

    Hi @darrenfloyd666 

     

    So this seems to be a formatting issue,

     

    Can you try and create another Compose action below the first one.

    So now you will have 2 compose actions,

     

    1 for storing the dynamic value for Holiday_allocation.

    and in the second Compose, use the int() expression and put the outputs of the first compose in the ( )

  • sutekh Profile Picture
    509 on at

    Actually that worked! The expression was 

    int(triggerOutputs()?['body/Number_of_dates_requested']) Thanks. Got a separate issue but that's another matter.
     
    Thanks @Jcook 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 423

#2
11manish Profile Picture

11manish 308 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 177

Last 30 days Overall leaderboard