Thanks @BartoszWachocki-4076 for posting the additional details. Please find below observations
- "Set Variable" activity cannot connect to SQL database and fetch the result. It is treating the query as string and hence it is trying to match it with 1. Since it is never same, it is always going to false
- "Lookup" activity can be used when we need results from SQL - I have created a stored procedure at SQL and called it from lookup to capture the result of case statement shown above
- I checked with product team and converting the string variable to int is making bool function work without having to use equals as well. @bool(int(string(activity('Lookup1').output.firstRow.value)))
All this is shown in GIF below.
Hope this helps! Please let us know for further queries and we will be glad to assist.