Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
narendranj
Frequent Visitor

Pipeline - Set Variable activity not working properly

Trying to update a pipeline variable value through `Set Variable` activity and it is getting success but not reflected the new value in the variables tab or when accessing this variable on any other activity. Always showing the default value that I set when creating that variable.
Variable - The `last_run_date` is the variable and it's defualt value is `2024-01-01`:
narendranj_6-1716271293291.png

Pipeline activities:

narendranj_7-1716271392314.png

Web activity - Using that variable in the URL by setting dynamic content:

narendranj_8-1716271500600.png

Set Variable activity - After the successful run of web activity, updating that variable value as current date:

narendranj_9-1716271583909.png

Run results of FIRST time:

narendranj_10-1716271649809.png

Web activity - The defult value of `last_run_date` is set correctly:

 

narendranj_11-1716271698242.png

 Set Variable activity - The current date `2024-05-21` is set correctly:

narendranj_12-1716271799341.png
Variable - The default vaule is not being updated:
narendranj_13-1716271911867.png
Run results of SECOND time:
narendranj_14-1716272145329.png

 

Web activity - The updated value (2024-05-21) of `last_run_date` is not set correctly, still it is taking the default value (2024-01-01) that I set initially:
 
narendranj_16-1716272356233.png
1 ACCEPTED SOLUTION
Ray_Minds
Continued Contributor
Continued Contributor

Based on my understanding, variables values are only available for current session. we couldn't be used after the session closed. so you will need to store variable "Last_run_date" value in some locations like (blob storage, data lake etc.. as per your convenience).
Please follow the below step :-
1. Choose the lookup activity then configure the connection where have been to store location of variable "Last_run_date".

2. Now you choose the webactivity and configure the "Relative URL" as per mentioned in the below:-
api/v1/employees? date = @activity('Lookup').output.value.

3. Now you add a variable(Last_run_date) as you mentioned.

4. Then choose the copy activity that help to store "last_run_date" variable. please follow below step to config.
a). Create a dummy dataset as source. go to "additional column" >> add column name like ("Last_run_date")
>>>> go the column value and click on "add dynamically content" then select the variables.
b). Create a sink dataset where to store "Last_run_date" value.

I hope that would be helpful for you.

View solution in original post

6 REPLIES 6
Ray_Minds
Continued Contributor
Continued Contributor

Based on my understanding, variables values are only available for current session. we couldn't be used after the session closed. so you will need to store variable "Last_run_date" value in some locations like (blob storage, data lake etc.. as per your convenience).
Please follow the below step :-
1. Choose the lookup activity then configure the connection where have been to store location of variable "Last_run_date".

2. Now you choose the webactivity and configure the "Relative URL" as per mentioned in the below:-
api/v1/employees? date = @activity('Lookup').output.value.

3. Now you add a variable(Last_run_date) as you mentioned.

4. Then choose the copy activity that help to store "last_run_date" variable. please follow below step to config.
a). Create a dummy dataset as source. go to "additional column" >> add column name like ("Last_run_date")
>>>> go the column value and click on "add dynamically content" then select the variables.
b). Create a sink dataset where to store "Last_run_date" value.

I hope that would be helpful for you.

Noted, thanks! Yes, this is how I already implemented the workaround.

narendranj_0-1716360861514.png
Regarding the behavior of the Set Variable activity: I have a different view from its current functionality. I don't see the benefit of holding variable values only for the current session. I believe it should be designed to dynamically update pipeline variable values.

 

Hi @narendranj 

 

Just checking back to see if you have a resolution yet. In case if you have any resolution please do share that same with the community as it can be helpful to others.

If the issue still persist, please do let us know. We will try to help.

 

Thank you.

Hi @narendranj 

 

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. In case if you have any resolution please do share that same with the community as it can be helpful to others .
If you have any question relating to the current thread, please do let us know and we will try out best to help you.
In case if you have any other question on a different issue, we request you to open a new thread.

 

Thanks.

v-cboorla-msft
Microsoft Employee
Microsoft Employee

Hi @narendranj 

 

Thanks for using Microsoft Fabric Community.

Could you please try to interchange the connection between Web and Set variable and then try to execute the pipeline. I have tried to repro the scenario, please find the screenshots for reference.

vcboorlamsft_0-1716285965782.png

vcboorlamsft_1-1716286018713.png

vcboorlamsft_2-1716286027681.png

If the issue still persists, please do let us know. Glad to help.

 

I hope this information helps.

 

Thank you.

@v-cboorla-msft Thanks for the response. My scenario is a bit different: I need to set `last_run_date` to the current date once all API calls are completed. This current date will be used by my API to fetch records from after this date the next time it runs. My pipeline will be running on a scheduled basis. Could you please suggest how I can achieve this?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

May FBC25 Carousel

Fabric Monthly Update - May 2025

Check out the May 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.