Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Triggers
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Resources
  • Get help with flow
Menu

How to use number from MS Forms in a Power Automate condition

Posted on November 7, 2021November 7, 2021 by Tom

“I’d like to send different notification for good and bad rating via MS Forms form, but my Power Automate condition to check the number doesn’t work.

“The template language function ‘greater’ expects two parameter of matching types. The function was invoked with values of type ‘String’ and ‘Integer’ that do not match.


If you use Microsoft Forms to collect feedback, you might collect also some kind of rating. It can be a star rating, number rating, or just a text field to type in a number. The flow can then behave differently depending on this rating. It can send a notification if there’s a bad rating for immediate feedback, or reply with a ‘thank you’ message for a good one. It could also store the response in a SharePoint list to keep track of the bad reviews. But no matter what the flow does, you must always use a ‘Condition’ to evaluate the rating. And that’s where you might encounter a problem if you use the ‘less’ or ‘greater’ condition.

Power Automate Forms number condition

Convert the values

As the error message will tell you, you’re trying to compare a string with an integer. A text with a number. The ‘Condition’ needs both of the sides with the same type. You need either 2 strings or 2 integers, but you can’t combine them (the exception being ‘is equal to’ condition).

As it must be 2 strings or 2 integers, you’ve got two options how to change the type. You can use the string(…) or int(…) expression to change the left or the right side of the condition, e.g.

int(Rating) <operator> number
or
Rating <operator> string(number)

Warning: don’t try to convert the number to string using single quotes, e.g. ‘3’. Such condition won’t work properly.

Summary

All the information Power Automate will extract from MS Forms will be provided as a string, and as such it won’t work in a condition with a number. Such condition will end with an error, unless you convert one of the sides to the right format. And it’s up to you if you want to convert the left or the right side (but the right side is easier).


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Do you know what to do, but not how to do it?

Get The Ultimate Power Automate expressions cheat sheet and translate your thoughts into flows with ease!


NEW! Master the HTTP requests to SharePoint with a new cheat sheet!

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Hello and welcome!

My name is Tom and I'm a business process automation consultant and Microsoft MVP living in the Czech Republic. I’ve been working with Microsoft technologies for almost 10 years, currently using mainly Power Automate, SharePoint, Teams, and the other M365 tools.

I believe that everyone can automate part of their work with the Power Automate platform. You can achieve a lot by "clicking" the flows in the designer, but you can achieve much more if you add a bit of coding knowledge. And that's what this blog is about.

To make the step from no-code Power Automate flows to low-code flows: using basic coding knowledge to build more complex yet more efficient flows to automate more of your daily tasks.

  • Use Power Automate to forward Outlook events upon registrationJanuary 29, 2023
  • Why the condition is false for the same numbers (Power Automate)January 25, 2023
  • How to forward event invitation to other calendar (Power Automate)January 22, 2023
  • Run ‘For selected item’ flow from non-default environment (Power Automate)January 18, 2023
  • Hide button in SharePoint list after Power Automate flow startedJanuary 15, 2023

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2023 Let's POWER Automate | Theme by SuperbThemes