Search code examples
azureparametersazure-data-factoryazure-databricks

Pass the notebook output as paramater to copy activity


I have the simple query in dabricks notebook that gives me an output which Im willing to use a parameter inside the copy activity.

my notebook output strcture looks like thi:

"runOutput": {
    "values": [
        {
            "CHANGENR": "0209193944"
        }
    ]
},

Moreover, I also defined the parameters outside of the acitivities, such as incremental_rule and so on. enter image description here

I would like to pass the notebook output 0209193944 inside the copy activity, which should be concatoned with incremental_rule parameter.

enter image description here

tried this did not work.

@{concat(pipeline().parameters.incremental_rule, activity('COPY_SAP_TABLE_CDPOS').output.runOutput.values,'''')}

and the output is this

enter image description here

my desired output should look like this.

enter image description here


Solution

    • Since you need to concatenate the value, you need to use property selection on the Databricks activity output to get the desired result. The following is a demonstration of the same:

    enter image description here

    • Replace the dynamic content activity('COPY_SAP_TABLE_CDPOS').output.runOutput.values with the following to achieve your requirement:
    activity('COPY_SAP_TABLE_CDPOS').output.runOutput.values[0].CHANGENR
    

    enter image description here

    • Since you are already using String interpolation, there is no need for concat. So, I used something like below which gave the desired result with the value of incremental_rule parameter is ((OBJECTCLAS='BELEGR' and TABNAME='BSEGR') or (OBJECTCLAS = 'BELEG' and TABNAME='BSEG)) and CHANGENR>:
    @{pipeline().parameters.incremental_rule}'@{activity('COPY_SAP_TABLE_CDPOS').output.runOutput.values[0].CHANGENR}'
    

    enter image description here