Resolving Type Mismatch Warning in ADF

Glasier 440 Reputation points
2023-12-27T18:47:07.8166667+00:00

I'm incorporating an If Condition in my ADFv2 Pipeline, contingent on the output of an activity. I'm checking if a file is downloaded, and if affirmative, I aim to load the table with the downloaded file.

The expression is formulated as follows:

@{equals(activity('RunFunction').output.files[1].Downloaded, true)}

However, I'm encountering the following warning:

The expression of type 'String' does not match the field 'expression'.

Thanks

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

Accepted answer
  1. Subashri Vasudevan 11,231 Reputation points Volunteer Moderator
    2023-12-28T01:53:54.5933333+00:00

    Hello Glasier-3173

    Are you using it directly on if? or trying to assign to a variable?

    If you are directly using it on If condition, it will not say that warning, (Note the the curly braces at the outermost is not required). This is because, If condition expression should evaluate to true or false and your expression involving equals should work fine.

    @equals(activity('RunFunction').output.files[1].Downloaded, true)

    If you are trying to assing to a string variable, use the below expression

    @string(equals(activity('RunFunction').output.files[1].Downloaded, true))

    This will be converting the equals output (true or false) to a string and that can be assigned to a variable of type string.

    Hope it is clear. Please try and let us know.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.