ADF-Mapping Data flows

Madugundu Somashekara, Roopa 46 Reputation points
2022-09-27T06:27:36.16+00:00

Hi,

I have a requirement that in my source in some of the fields of string type, we have string starting and ending with single quotes (') for example like 'abcdefgh'. In mapping dataflows, we need to check that the string is starting and ending with single quotes, if yes, then both the leading and trailing single quotes must be removed.

How can this be achieved in mapping dataflows. Any help is appreciated!

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,623 questions
{count} votes

1 answer

Sort by: Most helpful
  1. KranthiPakala-MSFT 46,642 Reputation points Microsoft Employee Moderator
    2022-09-30T00:11:30.89+00:00

    Hello @Madugundu Somashekara, Roopa ,

    Thanks for the question and using MS Q&A platform.

    You can use trim() function in your expression to remove leading and trailing characters.

    Use this expression and it should help remove trailing and leading characters

    trim(sourceColumnName, '\'')  
    

    Here is a sample:

    246218-image.png

    In case if you have single quotes or a special character anywhere in the give string then you can use replace() function. Please see example below:

    replace(souceColumnName, '\'', '')  
    

    246252-image.png

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.