Click here to Skip to main content
15,887,585 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
we are trying to concatinate three strings including " in it, but Azure data factory adding as ". Question is how do we get rid of \ character. I Have one set variable returning value ABCDEFG and I wanted to concatenate with other data to populate like below in a variable. {"value"}:{"ABCDEFG"}

Appreciate for help

What I have tried:

I am using the syntax in set variable like @replace(concat('{','"','value:',variables('requiredvalue'),'}'),'\ ','') and I am getting output value as "value": "{"value:ABCDEFG}"
Updated 26-Mar-24 19:11pm
v2

1 solution

If you are trying to get rid of \ without, that part of the @replace should be '\'. Your example has a space in the replace part, which would only match entries that have \ followed by a space. So, at this point, your replace would look like this:
@replace(concat('{','"','value:',variables('requiredvalue'),'}'),'\','')
As for creating the string output you are after, that's as simple as adding extra parts into the strings in your concat like this:
@replace(concat('{','"value":','"',variables('requiredvalue'),'"}'),'\','')
 
Share this answer
 
v3
Comments
thanks for the reply but I still see the same result with back slash added to it.
Pete O'Hanlon 27-Mar-24 11:05am    
That was my mistake - I copied your original code in and left the space in '\ '. I've just updated the answer. Also, if you post what you're actually getting back, that would help.
sure, I am getting "Syntax error: Missing enclosing parenthesis"
I try adding and changing parenthesis positions but still getting same error. I used below string
@replace(concat('{','"','value,'"','}:','"',variables('requiredvalue'),'"','}'),'\','')
Pete O'Hanlon 27-Mar-24 11:32am    
I have simplified the string. I was getting too cocky with the input and miscounted the ' characters.
Got it, not sure where I am missing but still getting same output

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900