How to remove/replace this character i.e. (\",\") from variable expression value?

Viewed 288

Have a variable output in ADF as below:

{
    "name": "variable1",
    "value": "[\"(NAME\",\"varchar,HEADER1\",\"varchar,HEADER2\",\"varchar,START_DATE\",\"date,END_DATE\",\"date)\"]"
}

Need output value like below which I can pass to SQL for table creation:

( NAME varchar,
  HEADER1 varchar,
  HEADER2 varchar,
  START_DATE date,
  END_DATE date
)

Tried using @uriComponentToString(), @replace() as both space/horizontal tab(%09), but still no luck.

The above variable expression which has this character is an output from previous variable expression i.e.

@string(skip(split(string(variables('removeNewLineChars')),' '),3))

Further to add, the requirement is also to have the values after comma (,) in new line (LF) so that when passing this statement to SQL database, we don't receive error as :- The identifier that starts with <> is too long. Maximum length is 128.

Updated

Was able to figure out this character actually is "," - so was able to replace it with a single space i.e. @replace(variables('variable1'), '","',' ')

Now, I just have "[" in the beginning and at end "]"

"[\"(NAME varchar,HEADER1 varchar,....\"]" 

Only thing left is to transform this further with a new LF like below.

( NAME varchar,
  HEADER1 varchar,
  HEADER2 varchar,
  START_DATE date,
  END_DATE date
)

enter image description here

0 Answers
Related