Thanks for reaching out to Microsoft Q&A.
- Define the Pipeline Parameter:
- Create a pipeline parameter, e.g.,
SourceSystem
, which will hold the value to determine the source query.
- Create a pipeline parameter, e.g.,
- Add a Lookup Activity:
- Drag a Lookup activity onto the pipeline canvas.
- In the Lookup activity settings, configure the source dataset.
Set the Source Query Dynamically:
- In the Lookup activity, use an expression to set the source query based on the pipeline parameter. For example:JSON
{ "source": { "type": "AzureSqlSource", "sqlReaderQuery": { "value": "@concat('SELECT * FROM ', pipeline().parameters.SourceSystem, 'Table')", "type": "Expression" } } }
- This expression concatenates the parameter value with the table name to form the query.
Use ForEach Activity:
- Add a ForEach activity to process the data returned by the Lookup activity.
- Configure the ForEach activity to iterate over the items returned by the Lookup.
Additional Resources
This approach allows you to dynamically set the source query based on the pipeline parameter and process the data within a single pipeline
Hope this helps. Do let us know if you any further queries.