cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kyza
Helper II
Helper II

Compose subtract from a variable

Hello,

I am currently building a flow, where I need to help myself with some "flags" and I like to use numbers to see the status.

 

Now when I am doing the "month countdown" my flow runs each week and if the value is still not 0 it should continue to substract until the value is 0 each week.

 

So, I am trying to achieve this by having Initializing Variable which is equal to some value from SharePoint, let's say 4. And then I need to write a formula that would do something like sub(@{variables('HelpVariable1')},1), but I am not really sure if I am getting the syntax right. I did not fully understand it yet and any guide, how to write formulas would be really useful.

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

Hi @Kyza,

 

There is no sub() function in Flow, but you could use add() function to achieve it.

So, it could be add(variables('HelpVariable1'),-1)

Annotation 2020-05-05 135610.png

 

But it seems like you want to value it back to variable HelpVariable1, so maybe you could have a try that using Decrement variable action, put the 1 into it, it will sub 1 to itself:

Annotation 2020-05-05 135631.png

 

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

View solution in original post

3 REPLIES 3
v-litu-msft
Community Support
Community Support

Hi @Kyza,

 

There is no sub() function in Flow, but you could use add() function to achieve it.

So, it could be add(variables('HelpVariable1'),-1)

Annotation 2020-05-05 135610.png

 

But it seems like you want to value it back to variable HelpVariable1, so maybe you could have a try that using Decrement variable action, put the 1 into it, it will sub 1 to itself:

Annotation 2020-05-05 135631.png

 

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

View solution in original post

Hello @v-litu-msft ,

thanks for your reply.

 

I will definitely give it a shot, but according to this post and many others sub() expression should be in flow, even the expression builder offers it in it's "intellisense".

https://powerusers.microsoft.com/t5/General-Power-Automate/How-do-I-substract-two-values-from-sharep...

 

I will let you know with results 🙂 Thanks.

v-litu-msft
Community Support
Community Support

Hi @Kyza,

 

Sorry, no sub() function is a flash in my head, as a matter of fact, there is.

 

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

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (47,775)