Skip to main content

Notifications

Community site session details

Community site session details

Session Id : EPaS0S/7JY7TT9W1qfZyyL
Power Automate - Building Flows
Answered

Get a Row - Calculated Column returning as String (instead of number)

Like (0) ShareShare
ReportReport
Posted on 31 Aug 2023 10:40:19 by 104

I have a "Get a Row" action in my Flow. Within the Excel file, there is a calculated column that is set to 'Number' format. However when using this in the Flow, it adds on 13 decimal places to values in this column whereas in the Excel file, it is only set to 2 decimal places. The Flow looks like it is returning the value as a string rather than an integer. 

 

get a row.JPG

 

In the Flow, I have tried adding a Compose action with both formatNumber() and also Int() using the output from the Compose action in the screenshot above, but I am getting the below error messages:

 

Unable to process template language expressions in action 'Compose_2' inputs at line '0' and column '0': 'The template language function 'Int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.

 

Unable to process template language expressions in action 'Compose_2' inputs at line '0' and column '0': 'The template language function 'formatNumber' 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#FormatNumber for usage details.'.

 

Does anyone have any ideas? Thanks!

 

 

 

 

  • SamB2 Profile Picture
    104 on 31 Aug 2023 at 11:04:16
    Re: Get a Row - Calculated Column returning as String (instead of number)

    @Jondoesflow @Matthy79 

     

    Thanks guys, the float function worked perfectly!

  • Verified answer
    JonDoesFlow Profile Picture
    1,304 on 31 Aug 2023 at 10:55:30
    Re: Get a Row - Calculated Column returning as String (instead of number)

    Hey, ok cool. As @Matthy79 suggests, try using the float to convert the number

     

    formatnumber(float(triggerBody()['number']),'0.00')

  • SamB2 Profile Picture
    104 on 31 Aug 2023 at 10:53:58
    Re: Get a Row - Calculated Column returning as String (instead of number)

    Hi @Jondoesflow 

     

    I think the issue is that the Flow is not returning the Excel column value as a number, as I have just tried your suggestion and am getting the below error message:

     

    error.JPG

     

    Just for reference, this is what the action looks like (I have blocked out the column name):

     

    flow.png

  • Matthy79 Profile Picture
    4,178 Super User 2024 Season 1 on 31 Aug 2023 at 10:53:36
    Re: Get a Row - Calculated Column returning as String (instead of number)

    It looks like the value you provide is a decimal that comes as a string. FormatNumber needs a Number and int needs a string that can be converted to integer. Have you tried to convert the string to a decimal/float?

  • JonDoesFlow Profile Picture
    1,304 on 31 Aug 2023 at 10:47:10
    Re: Get a Row - Calculated Column returning as String (instead of number)

    Hi,

     

    Yes, you need to write the expression as:

     

    formatnumber(triggerBody()['number'],'0.00')
     
    where "triggerBody()['number']" is the number coming from the get a row step.
     


    ---------------------------------------------------------------------------


    If I have helped you with an answer, please accept this post as a solution and thumbs up my reply. Thanks !

    Blog - JonDoesFlow
    Twitter - JonDoesFlow
    YouTube - JonDoesFlow

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 51

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 39 Super User 2025 Season 1

#3
CU30040420-0 Profile Picture

CU30040420-0 23

Overall leaderboard