Replacing single quote/apostrophe with nothing

I am trying to replace a single quote with nothing using the formula tile in Magic ETL, but it is giving me a syntax error. According to MySQL, you should be able to use a backslash as an escape character so that it will process correctly, but Domo is giving me an error. Any ideas?


**Check out my Domo Tips & Tricks Videos

**Make sure to <3 any users posts that helped you.
**Please mark as accepted the ones who solved your issue.
Tagged:

Best Answers

  • GrantSmith
    GrantSmith Coach
    Answer ✓

    ETL Formula tile doesn't seem to want to handle single quotes correctly. I've been able to get it to remove single quotes using the Replace Text tile but you may have to put in the single quote a couple times as I've had it remove the single quote and replace my single quote with empty string.

    You can copy the JSON code below and paste it into your ETL which should remove the single quotes. You'll just need to update the field names.

    {"contentType":"domo/dataflow-actions","data":[{"name":"Replace Text","id":"5a02f438-db47-4f1d-ac57-484a94fcf775","type":"ReplaceString","gui":{"x":156,"y":180},"dependsOn":["0c670718-8546-4cc5-a42b-51e326b70b6c"],"removeByDefault":false,"notes":[],"fields":[{"inStreamName":"Promotion","useRegex":false,"replaceString":"'","replaceByString":"","wholeWord":false,"caseSensitive":false}]}]}
    
    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • tejusarora
    tejusarora Member
    Answer ✓

    Hi Mark,


    SQL uses two single quotes to represent one in a string. so try using

    REPLACE(`Longitude`,'''','')
    

    This should definitely work

    @MarkSnodgrass

Answers

  • GrantSmith
    GrantSmith Coach
    Answer ✓

    ETL Formula tile doesn't seem to want to handle single quotes correctly. I've been able to get it to remove single quotes using the Replace Text tile but you may have to put in the single quote a couple times as I've had it remove the single quote and replace my single quote with empty string.

    You can copy the JSON code below and paste it into your ETL which should remove the single quotes. You'll just need to update the field names.

    {"contentType":"domo/dataflow-actions","data":[{"name":"Replace Text","id":"5a02f438-db47-4f1d-ac57-484a94fcf775","type":"ReplaceString","gui":{"x":156,"y":180},"dependsOn":["0c670718-8546-4cc5-a42b-51e326b70b6c"],"removeByDefault":false,"notes":[],"fields":[{"inStreamName":"Promotion","useRegex":false,"replaceString":"'","replaceByString":"","wholeWord":false,"caseSensitive":false}]}]}
    
    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • tejusarora
    tejusarora Member
    Answer ✓

    Hi Mark,


    SQL uses two single quotes to represent one in a string. so try using

    REPLACE(`Longitude`,'''','')
    

    This should definitely work

    @MarkSnodgrass

  • @tejusarora Thanks! I tried that earlier and it was giving me an error, but now it is working as well.

    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.