Hi all, I have run into this strange issue where I cannot convert Kusto query results into integers with combo of expression and Data Operation in Power Automate.
First, I wrote this Kusto Query:
Cluster URL: https://hwinventory.kusto.windows.net/
Database: hwinventory
Query:
When I run the flow, I would always get this error message saying that:
Action 'Convert_Bin_Age_of_ZQZ22_to_Integer' failed.
Unable to process template language expressions in action 'Convert_Bin_Age_of_ZQZ22_to_Integer' inputs 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.'.
I also tried changing the last line of my Kusto query to:
| project Age = iif(isempty(Age), "0", tostring(Age))
but I got the same error message. I am pretty sure my query is fine because it runs okay in Azure Data Explorer.
I could not for the life of me figure out what went wrong. I believe I composed my steps correctly and start to wonder there's something wrong with Power Automate. Would highly appreciate it if somebody can help me out here.
Hi @siwfy ,
Please consider accept you reply as solution so other uses will be able to find it quickly.
Best regards,
Seems the issue was caused by the feature that when query results are composed in the flow, they come with the title. What I need to do is use split formula to extract the number from the query result first and then convert it to an integer. Simple as that.
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492