AZURE DATA FACTORY: THE EXPRESSION CONTAINS SELF REFERENCING VARIABLE. A VARIABLE CANNOT REFERENCE ITSELF IN THE EXPRESSION

Nitish Kumar
Jun 3, 2021

Self refer a variable in a Set Variable Activity

In Azure Data Factory, you might encounter an error: “The expression contains a self-referencing variable. A variable cannot reference itself in the expression.” This error is due to a restriction in the Set Variable Activity to self-reference a variable.

As a workaround, you can create another variable that you will do your activity and then assign the result to your initial variable. Both your variables will have initially the same value.

Creating two variables “file_id_current” and “file_id_min”.

As an example, we have a variable “file_id_current” that will be incremented. We will use another variable called “file_id_min” that will have initially the same value as “file_id_current”. As the first step we will calculate the incremented value using the expression:

@string(add(int(variables(‘file_id_min’)), 1))

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Nitish Kumar
Nitish Kumar

Written by Nitish Kumar

Data engineer / Python / NodeJS

Responses (1)

Write a response