Appending String to every Element of an Array without using Iteration Activities via Synapse / Data Factory Pipeline

Problem Statement :

How at Append a string to every element :

Input :

Output :

GitHUB Code

Is it possible to achieve the same without the use of any Iteration Activities.

Note : One cannot use Iteration Activities within Iteration Activity , thereby leading for creation of a new Pipeline and leveraging Execute Activity within the iteration activity.

Prerequisites :

  1. Azure Data Factory / Synapse

Solution :

With iteration being ruled out, one can achieve this by converting the Array to a string, leverage REPLACE function, CONCAT function, and then SPLIT to turn it back into array again.

GitHUB Code

  1. JOIN the Input Array together into a String using (‘abc’ + ‘;’) as Separator

OUTPUT : 1abc;2abc;3

2. CONCAT the addition string ‘abc’ to the end of the string

OUTPUT : 1abc;2abc;3abc

3. SPLIT the string back into Array using ‘;’ as a Separator

OUTPUT : [“1abc”,”2abc”,”3abc”]

To Append the String in front of the Element as below :

Leverage the below expression (rearranging the expression used above) :

Published by Nandan Hegde

Microsoft Data MVP |Microsoft Data platform Architect | Blogger | MSFT Community Champion I am a MSFT Data Platform MVP and Business Intelligence and Data Warehouse professional working within the Microsoft data platform eco-system which includes Azure Synapse Analytics ,Azure Data Factory ,Azure SQL Database and Power BI. To help people keep up with this ever-changing landscape, I frequently posts on LinkedIn, Twitter and to his blog on https://datasharkx.wordpress.com. LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66 GitHUB Profile : https://github.com/NandanHegde15 Twitter Profile : @nandan_hegde15 MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942

Leave a comment

Design a site like this with WordPress.com
Get started