How to Fix Power Automate InvalidTemplate Error When Summing SharePoint Values
Question details
The user's Power Automate flow fails with an InvalidTemplate error when attempting to sum values between SharePoint lists due to unconvertible data types passed to the int() function.
- Product
- Microsoft Power Automate
- Device & OS
- not provided
- Scenario
- Summing number values from one SharePoint list to another using a cloud flow.
- Observed behavior
- The flow fails with an InvalidTemplate error because the int function encounters a value, such as a null or empty string, that it cannot convert to an integer.
Verify that the SharePoint columns you are attempting to sum are strictly formatted as Number columns and check your data sets for any blank or null entries before running the flow.
Use the Coalesce Function to Handle Null Values
Prevent the int() function from failing by using coalesce() to replace null or empty string values with a zero before calculation.
The most common reason for the InvalidTemplate error during an int() conversion is that the flow encounters a blank cell in your SharePoint list. By wrapping your dynamic content in a coalesce() function, you can force Power Automate to treat blank values as zeroes.
Open your Power Automate flow, navigate to the specific step that is failing, and click to edit the expression where the int() function is used.
Modify the expression to wrap the SharePoint dynamic content with the coalesce() function. For example, update it to: int(coalesce(item()?['YourColumnName'], 0)).
Save your flow and run a manual test to ensure empty fields are now treated as zero instead of causing the InvalidTemplate error.
Seek Assistance from the Power Platform Community
If the error persists after handling null values, gather your flow details and consult experts in the official Microsoft community forum.
Manage Your Data Seamlessly with WPS Office
While Power Automate and SharePoint are specific to the Microsoft ecosystem, if you are looking for a highly compatible, lightweight, and free solution for managing your spreadsheets, documents, and presentations locally, WPS Office is an excellent choice.
- 1. Download and Install: Visit the official WPS website to download and install WPS Office for free on your device.
- 2. Open Your Spreadsheets: Launch WPS Spreadsheet and open your exported SharePoint data or Excel files.
- 3. Process Data Locally: Use built-in SUM functions, pivot tables, and advanced data formatting to manage your lists without complex cloud flows.

Frequently Asked Questions
Why does the int() function cause an InvalidTemplate error in Power Automate?
This error typically occurs when the int() function receives a null value, an empty string, or text characters that cannot be mathematically converted into an integer during the flow run.
How can I check for empty values in my SharePoint list before summing?
You can use a Condition control in your Power Automate flow to check if the specific SharePoint column is equal to 'null' before passing the data to your calculation or variable steps.
Can I use float() instead of int() for SharePoint number columns?
Yes. If your SharePoint list contains decimal values, using float() instead of int() is required to prevent truncation and conversion errors. However, float() will still fail if it receives a null or empty value.




