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 / How to convert string ...
Power Automate
Answered

How to convert string to integer

(0) ShareShare
ReportReport
Posted on by 33

Hi everyone,

 

I am using a AI model to extract information from an invoice document. 

One of the extracted informations is the total value of the invoice, the extracted information as value is a total number, but the text result is the actual correct output since it´s providing the currency and the comma.

I now want to use the extracted text, convert it to int to use it in a condition to check, so if the amount is higher then 1000 a specific action has to happen.

Can anyone help me in setting up the correct flow?

lisa_garcia_0-1704267255425.png

 

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @lisa_garcia ,

     

    To convert currency string to number, you need below expression:

    int(substring(outputs('Compose'),2,sub(length(outputs('Compose')),2)))

    vjefferni_0-1704272132215.png

     

    Best regards,

  • lisa_garcia Profile Picture
    33 on at

    Hi @v-jefferni 

    I tried your solution but get another error:

    lisa_garcia_0-1704274545602.png

    the compose 2 looks like this: 

    int(substring(outputs('Verfassen'),2,sub(length(outputs('Verfassen')),2)))
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @lisa_garcia ,

     

    So, the currency symbol is in the end. You can edit the expression as follow:

    int(substring(outputs('Verfassen'),1,sub(length(outputs('Verfassen')),1)))

     

    Best regards,

  • lisa_garcia Profile Picture
    33 on at

    hi @v-jefferni 

    It almost works but I´m missing a digit 

    lisa_garcia_0-1704285313195.png

    Any idea?

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @lisa_garcia ,

     

    Just need to extract substring from the first digit:

    int(substring(outputs('Verfassen'),0,sub(length(outputs('Verfassen')),1)))

     

    Best regards,

  • lisa_garcia Profile Picture
    33 on at

    Hi @v-jefferni 

    thanks so much for helping me!

    So I´m geeting a result, but still missing the two digits.. How do I get the number right? 

    Tried float but it isn´t working...

    lisa_garcia_0-1704380317352.png

     

    regards

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @lisa_garcia ,

     

    Try below and you can get the currency:

    formatNumber(float(substring(outputs('Compose'),0,sub(length(outputs('Compose')),1))),'$ #,###.00')

     

    Best regards,

  • lisa_garcia Profile Picture
    33 on at

    Thanks so much @v-jefferni it worked! 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 77 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 68

#3
Expiscornovus Profile Picture

Expiscornovus 56 Most Valuable Professional

Last 30 days Overall leaderboard