Evaluating a bit/boolean in ADF If Condition Activity

Pendleton, David 25 Reputation points
2024-11-13T20:35:55.0633333+00:00

You would think this would be incredibly simple, but apparently not.

A SQL statement used in a lookup returns either CAST(1 as bit) or CAST(0 as bit) to a pipeline as column is_enabled. An If condition activity (inside a For Each) uses this expression to determine which action to take:

@equals(item().is_enabled, true)

Unfortunately, this returns true regardless of the value of is_enabled. What is the correct way to accomplish this most basic of operations?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,625 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ganesh Gurram 7,295 Reputation points Microsoft External Staff Moderator
    2024-11-18T16:08:30.5+00:00

    @Pendleton, David - I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer

    Ask: Evaluating a bit/boolean in ADF If Condition Activity

    Solution: This actually turned out to be a GIT problem where changes were out of sync between branches. After some doing, I was able to get everything synched and it works as it should.

    If I missed anything please let me know and I'd be happy to add it to my answer, or feel free to comment below with any additional information. 

    If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue. 

    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members. 

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.