Forum Discussion
Resetting a string pipeline variable
- 6 months ago
Hi pmscorca ,
- You’re right that a dedicated reset function would be cleaner, but currently Fabric/ADF pipelines don’t support user-defined functions or setting variables to 'null'.
- The supported and recommended approach is to explicitly overwrite the variable with an empty string:
- Set Variable activity → value set to ' ' (empty string)
- Internally this is treated as a reset state, even though the run output may show "\n" due to UI serialization.
- For cleaner design, a common pattern is to encapsulate all variable resets inside a small reusable pipeline (called via Execute Pipeline), which effectively acts as a “reset function” while staying within supported features.
Ok, but I need to reset a string variable with a blank or empty string, not with a null.
About implementing a reusable pipeline to reset variables it should be called inside a main pipeline that has these variables, but the variables aren't global ones or you think to use pipeline return values, isn't it? Thanks
HI pmscorca ,
Yes, the reset is to a blank/empty string, not null. In Fabric/ADF pipelines, setting a string variable to '' is the only supported way to clear it, even though the run output may show "\n" due to UI serialization, it’s still treated as empty in expressions. Pipeline variables aren’t global, so a reusable child pipeline can’t directly reset variables in the parent unless pipeline return values are used and then assigned back in the main pipeline. Otherwise, explicitly using Set variable - '' in the main pipeline remains the simplest and cleanest supported approach.
- v-sshirivolu6 months agoCommunity Support
Hi pmscorca ,
I hope the information provided above assists you in resolving the issue. If you have any additional questions or concerns, please do not hesitate to contact us. We are here to support you and will be happy to help with any further assistance you may need.