Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified as a Fabric Data Engineer: Check your eligibility for a 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700. Get started

Reply
krishn
Helper I
Helper I

String concatination in ADF

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"}

I am using the syntax in set variable like @replace(concat('{','"','value:',variables('requiredvalue'),'}'),'\ ','') and I am getting output value as "value": "{"value:ABCDEFG}"

Appreciate for help

I am using the syntax in set variable like @replace(concat('{','"','value:',variables('requiredvalue'),'}'),'\ ','') and I am getting output value as "value": "{"value:ABCDEFG}"

expected output {"value"}:{"ABCDEFG"}

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hello @krishn ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet.
In case if you have any resolution please do share that same with the community as it can be helpful to others .
Otherwise, will respond back with the more details and we will try to help .

View solution in original post

Hi Team, as per the recommendation it is not required to eliminate \ special character from string. But we observed these special characters are printing when we copy it to CSV/text file in Blob storage. As long as value stay in Azure environment we do not have to worry about \ character. We are working on alternatives. Appreciate for help. 

View solution in original post

10 REPLIES 10
krishn
Helper I
Helper I

Apologies for delay, we validated the same and re-produced same result. Within the application it is excluding \ character however if we print this to a csv or txt file in blob object it is still printing the \ character.  Seems we have to use StoredProcedure or Databricks activities to pars string. Appreciate for help. 

Anonymous
Not applicable

Hi @krishn ,

Glad to know that you got some insights.
Please continue using Fabric Community on your further queries.

Anonymous
Not applicable

Hi @krishn ,

Thanks for using Fabric Community.
Can you please try this expression?

@concat('{"value"}:{"', variables('requiredvalue'), '"}')


Let me know if this works or not?

I tried this in first place but we are betting the below resule added \ to it, we also validated priting the same string but is still there. Ultimately we wanted to get rid of \ added 

 

"{\"value\"}:{\"ABCDEFG\"}"

Anonymous
Not applicable

Hi @krishn ,

\ is an escape sequence inorder to preserve " in string and it will not include when you print the output.

Escape Sequences | Microsoft Learn

For Example:

vgchennamsft_2-1711645894801.png

 



vgchennamsft_1-1711645817143.png

 

vgchennamsft_3-1711645952605.png

 

vgchennamsft_4-1711645978190.png

 



vgchennamsft_0-1711645744506.png


Hope this is helpful. Please let me know incase of further queries.

This is helpful, so we are planning to pass this variable to another web activity as input variable as a parameter in relative  string. So we don't have to exclude \ correct. Appreciate.

Anonymous
Not applicable

Yes there is no need to exclude \ as this is considered as escape sequence. Inorder to achieve your goal, you can use this -

 

@concat('{"value"}:{"', variables('requiredvalue'), '"}')

 


I hope this answers your query. Please let me know incase if you have further queries.

Anonymous
Not applicable

Hi @krishn ,

We haven’t heard from you on the last response and was just checking back to see if your query was answered.
Otherwise, will respond back with the more details and we will try to help .

Anonymous
Not applicable

Hello @krishn ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet.
In case if you have any resolution please do share that same with the community as it can be helpful to others .
Otherwise, will respond back with the more details and we will try to help .

Hi Team, as per the recommendation it is not required to eliminate \ special character from string. But we observed these special characters are printing when we copy it to CSV/text file in Blob storage. As long as value stay in Azure environment we do not have to worry about \ character. We are working on alternatives. Appreciate for help. 

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

JanFabricDE_carousel

Fabric Monthly Update - January 2025

Explore the power of Python Notebooks in Fabric!

JanFabricDW_carousel

Fabric Monthly Update - January 2025

Unlock the latest Fabric Data Warehouse upgrades!