Announcements
Hello,
I am encountering an error in Power Automate that I'm unable to resolve. The error occurs when I try to convert a survey response value (NPS score) into an integer in a Condition action.
Below is the exact error message:
Action 'Condition_4' failed: Unable to process template language expressions for action 'Condition_4' at line '0' and column '0': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.
Flow Details:
Trigger: When a new response is submitted in Microsoft Forms.
Action: The survey response includes a question for NPS (Net Promoter Score), and I’m trying to use the int() function to convert it into an integer to evaluate the response.
int()
Problem: The error indicates that the int() function is failing because the value cannot be converted to the target type (integer).
Steps Taken:
I have already tried using int() in the following expression:
int(triggerOutputs()?['body/NPS Question Dynamic Field'])
However, I keep getting the error "The template language function 'int' was invoked with a parameter that is not valid."
Request:
Can anyone explain what could be causing this issue with the int() function?
How can I ensure that the NPS value is converted to an integer properly, or should I use another approach to compare this value
Thank you in advance!
I ran into this same issue while building an NPS flow for one of my own automations, and what finally fixed it was treating the score as an integer inside the Condition.
In my case, I used int(<field from dynamic content>) on the NPS response and the comparison worked fine because that field was always populated with a numeric value. For your scenario, I’d start by testing the response field with isInt(<field from dynamic content>) so you can see whether the value is really a valid number every time.
int(<field from dynamic content>)
isInt(<field from dynamic content>)
If isInt() sometimes comes back as false (for example when the NPS question is skipped or left blank), that’s likely what’s triggering the “Unable to process template language expressions” error when you call int(). In that case, I’d handle the non‑numeric path separately—either by setting a default, skipping the calculation, or adding a branch that only runs int() when isInt() is true.
isInt()
✅ If this helped solve your issue, please Accept as Solution so others can find it quickly. ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :). 🏷️ For follow-ups @Sajeda_Sultana
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.
Jump in, show your community spirit, and win prizes!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Valantis 377
11manish 279
David_MA 234 Super User 2026 Season 1