web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Adding +1 to a variabl...
Power Automate
Unanswered

Adding +1 to a variable ; getting invalid templates errors related to the number field

(0) ShareShare
ReportReport
Posted on by 214

I am hoping someone can help me..... I am pretty lost

 

I am creating a small leaderboard for my boss to quickly see the referral totals for each branch.  I simply put the name of each branch on a SP list, and every time a new referral is created on a Separate SP list, every branch's score is currently at 0, and every time a refferal is created the flow is to add +1 to the number that is currently "Refferal Score" column for that branch location. 

 

The column in SP is data type = numbers

 

Here is the expression I created 

add(outputs('Get_items')?['body/TotalReferralPoints'],1)
 
mcnemare1_1-1666888391395.png

 

 

 

The error I am getting says:

InvalidTemplate. Unable to process template language expressions in action 'Update_item_2' inputs at line '0' and column '0': 'The template language function 'add' expects its first parameter to be an integer, a float or a decimal number. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#add for usage details.'.

 

mcnemare1_0-1666888135903.png

 

Now, my first instinct was to add int() to the expression so I changed the expression to :

 

add(int(outputs('Get_items')?['body/TotalReferralPoints'],1))

 

And I got this error: 

 

InvalidTemplate. Unable to process template language expressions in action 'Update_item_2' inputs at line '0' and column '0': 'The template language function 'int' expects one parameter: the value that is to be converted to an integer. The function was invoked with '2' parameters. Please see https://aka.ms/logicexpressions#int for usage details.'.

 

mcnemare1_2-1666888617458.png

 

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

    Hi @mcnemare1,

     

    Because it is within the loop I would use the item() reference instead.

     

    Can you try this and test if that makes a difference?

    add(item()?['TotalReferralPoints'],1)

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard