Thursday - last edited Thursday
I'm building a pipeline that takes contents from one system (via an API call using the HTTP connector) which is then being used to create/update an object in a different system (via the GraphQL connector issuing a mutation). The content coming from the source system, at times, can contain embedded quotes in the content that are escaped (ex. \") - especially when that content is HTML based. Content that does not contain escaped quotes is working without issue.
Example of the incoming content:
<p>Throughout this engaging session you will:</p>\n\n<ul>\n<li><span style=\"font-size:11pt\"><span style=\"font-family:Calibri,sans-serif\">Explore the transformative potential of leveraging low-code and no-code tools and workflows to automate repetitive and time-consuming office processes</span></span></li>\n<li><span style=\"font-size:11pt\"><span style=\"font-family:Calibri,sans-serif\">Capture data that can be used to make informed decisions regarding resource allocation</span></span></li>\n<li><span style=\"font-size:11pt\"><span style=\"font-family:Calibri,sans-serif\">Identify areas where investing time and energy can be most impactful</span></span></li>\n</ul> |
However, when it goes to use the content from that step in the recipe to use GraphQL, it appears that the escaped quotes are not being escaped - which, I think, is what is causing the GraphQL connector to have an error.
Example of the content being sent via GraphQL:
<p>Throughout this engaging session you will:</p> <ul> |
If I use the content with the escaped quotes and the escaped newlines to issue the same call using GraphQL to the destination system using Postman, the operation succeeds without issue.
Is there anyway to change things so that the content remains as it was originally ingested?
Solved! Go to Solution.
Thursday
Thank you for the suggestions! The issue was two-fold in that the escaped quotes were being un-escaped and the \n (or \r) were being expanded into newline or carriage returns. The solution which is working is to perform two .gsub operations
DATA.gsub(/(\r\n|\n|\r)/,'<p />').gsub('"','\"')
Thursday
Thank you for the suggestions! The issue was two-fold in that the escaped quotes were being un-escaped and the \n (or \r) were being expanded into newline or carriage returns. The solution which is working is to perform two .gsub operations
DATA.gsub(/(\r\n|\n|\r)/,'<p />').gsub('"','\"')
yesterday
Hi @bedelman0731 ,
Great to hear that, Happy to help.
Thanks and Regards,
Shivakumara K A