Forum Discussion

smahla's avatar
smahla
New Contributor II
3 years ago
Solved

Reusable pipeline- Unable to fetch variable value in child pipeline -Snowflake Snap

Usecase- We are looking at creating a reusable pipeline to load data from table1 from source DB to table1 in target DB. Plan is to reuse the same pipeline for n tables. Option 1 - Created mast...
  • tstack's avatar
    7 years ago

    You’re looking for the toObject() method on arrays. The method takes two callbacks, one to turn the array element into the key and one to turn the element into the value. I think the following will do what you want:

    $BrandData.toObject(elem => elem.Source + "-" + elem.SourceBrand, elem => elem.Brand)
    

    I’m also attaching an example pipeline with this expression.
    ArrayToObject_2019_07_26.slp (3.9 KB)