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 : Ap8DaNLli9TOZcD9ouKwE2
Power Automate - Building Flows
Answered

Converting a decimal number that is stored as a strong to an int or currency

Like (0) ShareShare
ReportReport
Posted on 16 Apr 2020 04:09:11 by 95

Hello,

 

I am trying to convert a decimal number (Ex: 1234.1) that is stored as a string in a CDS field to an integer or currency value to store in a currency field. 

 

I used the int() to convert and i had no issue if the value is without a decimal like 1234 however the int() fails when it has decimal value like 1234.1 . The error message i get is :

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

 

My flow action where i am using the int()

Int Function Flow 1.png

Any suggestions on how i can convert this string to an integer or a currency? Thanks in advance.

  • Nithin_Vanam Profile Picture
    95 on 17 Apr 2020 at 05:07:52
    Re: Converting a decimal number that is stored as a strong to an int or currency

    Thanks for the suggestion. Will give it a go later. 

  • v-alzhan-msft Profile Picture
    on 17 Apr 2020 at 05:04:07
    Re: Converting a decimal number that is stored as a strong to an int or currency

    Hi @Nithin_Vanam ,

     

    I kwon we could add the Number of decimal places for a Number/Currency type column in sharepoint, and then we could add the value with decimal in the column.

    Maybe you could take a try.

    1.png

    Best Regards,

    Alice

     

    Community Support Team _ Alice Zhang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Nithin_Vanam Profile Picture
    95 on 17 Apr 2020 at 04:44:14
    Re: Converting a decimal number that is stored as a strong to an int or currency

    @DeepakS , that worked like a charm. Thank you for that.

     

    @v-alzhan-msft : Is there any way i could retain the value after the decimal? For ex convert a string of "1234.5" to a numeric value of 1234.5 ?

     

    Thanks for all the help.

  • v-alzhan-msft Profile Picture
    on 16 Apr 2020 at 06:33:00
    Re: Converting a decimal number that is stored as a strong to an int or currency

    Hi @Nithin_Vanam ,

     

    Do you want to keep the integer part of the string and discard the fractional part of this value? Such as format the string  1234.1 to 1234 and then save the 1234 to the int or currency field, if yes, @DeepakS 's solution should work for you.

     

    Best Regards,

    Alice

     

    Community Support Team _ Alice Zhang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Verified answer
    DeepakS Profile Picture
    2,301 Most Valuable Professional on 16 Apr 2020 at 04:24:28
    Re: Converting a decimal number that is stored as a strong to an int or currency

    Hi @Nithin_Vanam 

     

    Try following expression :

     

    if(contains(string(outputs('decimalnumber')),'.'),split(string(outputs('decimalnumber')),'.')[0],outputs('decimalnumber'))
     
    (outputs('decimalnumber') is my variable that contain number (decimal or non decimal) replace this with your variable or field.
     
     
    -------------------------------------------------------------------------------
    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
     
     

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete