I need to create a simple flow which essentially counts the number of entries in the SQL Server table, then on condition check it whether it is greater than zero or not? If it is greater than zero send an email otherwise do nothing.
The error is coming
Unable to process template language expressions for action 'Condition' at line '0' and column '0': 'The template language function 'greater' expects all of its parameters to be either integer or decimal numbers. Found invalid parameter types: 'Object'.'.
The condition block is always failing.
This is the SQL query that I want to execute it.
SELECT count(*)
FROM [dbo].[ViewName]
where TriggerReport=1
My View/table look like this
CREATE VIEW [dbo].[ViewName] AS
SELECT
order_id,
required_date,
shipped_date,
CASE
WHEN DATEDIFF(day, required_date, shipped_date) < 0
THEN 1
ELSE 0
END TriggerReport
FROM
sales.orders
GO;
Flow look like this
You need to use length() expression to check the number of items present inside the views.
So expression goes like this.
length( Output of your Compose action )
You can use above expression in your condition to check if the entries are greater than 0.
Thanks,
Vivek
If this answer your query then accept this as solution and if you like the response then don't forget to provide thumbs up.