Passing Parameters to Digest MD5 function

Hi,

I am trying to read data for multiple tables from SQL server using a parent-child pipeline combination. As part of the process I will also need to determine the CDC. Now i have to sort the data before I send to Diff snap or write my own Logic. As I will be processing multiple tables from the same child pipeline i will not be able to select the fields in the Sort snap for Sort Path because each table will have different primary key columns and some times composite primary keys. So what i was thinking instead to concat the primary key values and then pass them to Digest.MD5 function so that it becomes one single column which i can then use for sorting data and determining CDC. The issue i am facing is if i create a pipeline parameter and pass the fields that needs to be concatenated then it is not working. But if i select the fields in expression builder manually then it is working. How do i pass the values of the strings that needs to be concatenated as parameter?

Working:
“”.concat($Emp_ID, $Group_ID) when selected from Source data coming

Not working:

Primary_Key = $Emp_ID, $Group_ID…parameter declared in pipeline properties
“”.concat(_Primary_Key)…It is creating output of ($Emp_ID, $Group_ID)

I used eval and it seems it will work. But documentation also says it will significantly impact performance. So any better way to do it?

Hi Rakesh,

Pipeline parameter values are set to be as string literal, so in the not working the “”.concat(_Primary_Key) is basically just concatenating the “$Emp_ID, $Group_ID”

If you want you can instead use a different approach like split and join…

in your pipeline parameter set the object the you want to concat e.g. Emp_ID|Group_ID

then in the child pipeline you can do a split and join

_Primary_Key.split(’|’).map((x) => $.get(x,’’)).join()

hope this helps :slight_smile:

1 Like