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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. 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

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. 

Hi @krishn ,

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

v-gchenna-msft
Community Support
Community Support

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

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.

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.

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 .

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
FabricCarousel_June2024

Fabric Monthly Update - June 2024

Check out the June 2024 Fabric update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.

Users online (1,004)