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 / Sub expression not wor...
Power Automate
Answered

Sub expression not working in Flow action

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Afternoon all

 

I've got a Flow where I'm trying to subtract the value from a field called 'Qty' in one list from a value in a field called 'Test qty' in a different as shown below:

 

QuantityINPUT.png

 

However expression isn't subtracting the values. This is the output from the tests I've run:

quantityOUTPUT.png

 

Where am I going wrong? All help appreciated!

Categories:
I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,768 Most Valuable Professional on at

    Hi @Anonymous,

     

    Can you remove the single quotation mark characters around the Qty and Test qty variables in your expression?

     

    It will think you are trying to subtract strings instead of integer or float values. using the sub function for strings is not supported. This should work:

    sub(0,20)

     

  • AdminofMk Profile Picture
    62 on at

    HI @Expiscornovus ,

     I want to subtract a value from a excel table and subtract with the flow input then i need to update the excel table with the output from subtraction.  i tried a flow but its giving me some error can you help me out please.

     

    AdminofMk_0-1670437176192.png

    AdminofMk_0-1670437367241.png

     

  • Expiscornovus Profile Picture
    33,768 Most Valuable Professional on at

    Hi @AdminofMk,

     

    It looks like your Remaining Leave field is text. Try and convert it to a decimal or a number.

     

    Try something like:

    sub(float(outputs('Get_a_row')?['body/Remaining Leave']), triggerBody()['number'])
  • AdminofMk Profile Picture
    62 on at

    Hi @Expiscornovus ,

     i double checked, the field was in number format only, 

    also i have tried the expression as your suggest, still same error occurs.

    AdminofMk_0-1670476091235.png

     

    AdminofMk_3-1670476622876.png

     

    AdminofMk_2-1670476603841.png

     

  • AdminofMk Profile Picture
    62 on at

    Hi @Expiscornovus ,

     Thanks for your effort to help me out, i found the solution. below expression works perfectly.

     

    AdminofMk_0-1670477037958.png

     

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 262 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 227

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard