'Power Automate - Subtract two integer variables

I am trying to subtract two integer values as such:

enter image description here

enter image description here

But I get this error: Unable to process template language expressions in action 'Negative_Index_of_Snabel-a' inputs at line '0' and column '0': 'The template language function 'sub' expects its first parameter to be an integer or a decimal number. The provided value is of type 'String'. Please see https://aka.ms/logicexpressions#sub for usage details.'.

I know that my variables in the sub() function is in quotes. But I cannot save it otherwise.



Solution 1:[1]

You're passing in literal string values, you need to specify that the values you want to evaluate are variables, like thus ...

sub(variables('VarMailInt'),variables('VarSnabelaIndex'))

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Skin