web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details
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.

  • 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.
     
     

Helpful resources

Quick Links

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading complete