This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
I have a set variable activity that returns a json object and I need to perform JS Array.prototype.map equiavlent in Data Pipeline.
Can you please help. I don't want to manually hardcode by array index inside a concat
const obj = {
"value": {
"colNames": [
{
"tbl_id": 2,
"tbl_name": "fact_Activity",
"src_colname": "col1",
"sample_datetime": "2024-08-02T04:23:18Z",
"last_run_at": "2024-08-02T00:23:40.071123Z"
},
{
"tbl_id": 2,
"tbl_name": "fact_Activity",
"src_colname": "col2",
"sample_datetime": "2024-08-02T04:23:18Z",
"last_run_at": "2024-08-02T00:23:40.071123Z"
},
{
"tbl_id": 2,
"tbl_name": "fact_Activity",
"src_colname": "col3",
"sample_datetime": "2024-08-02T04:23:18Z",
"last_run_at": "2024-08-02T00:23:40.071123Z"
}
]
}
const result = obj.value.colNames.map(a=>a.src_colname).join(",")
//'col1,col2,col3'
}
@join(activity('Script1').output.resultSets[0].rows,',')
// this joins all the key-value pairs
Solved! Go to Solution.
Hi @smpa01 ,
Yes, the regular js array methods are supported as of now. I'll let you know as soon as possible if subsequent tests reveal unsupported methods.
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @smpa01 ,
You can try to modify your code like below, this might potentially give you the result 'col1,col2,col3' without hard-coding the array index.
@join(activity('Script1').output.resultSets.rows.map(a => a.src_colname), ',')
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous are all js Array methods valid in pipeline expression?
Hi @smpa01 ,
Yes, the regular js array methods are supported as of now. I'll let you know as soon as possible if subsequent tests reveal unsupported methods.
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the April 2026 Fabric update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 2 | |
| 1 | |
| 1 |