from the official doc:
Use the Set Variable activity to set the value of an existing variable of type String, Bool, or Array defined in a Data Factory pipeline.
https://docs.microsoft.com/en-us/azure/data-factory/control-flow-set-variable-activity
You'll need to use the pipelines Variable first:
You can also find a good tutorial in here: https://www.mssqltips.com/sqlservertip/6136/azure-data-factory-pipeline-variables/