Jeremy Posted December 7, 2020 Posted December 7, 2020 When outputting via JSON the carriage returns are being shown as new lines breaks, we would like new lines to be sent as \n How do you change the output, we have tried using different field values e.g. field_3 and field_3_value and both appear to output the same What we get: What we want
Jeremy Posted December 8, 2020 Author Posted December 8, 2020 @Victor we are using a Integration node, Utilities/Experimental/HTTP Request
Victor Posted December 8, 2020 Posted December 8, 2020 @Jeremy ah, the HTTP request node. Must be that it returns formatted values so you won't have the \n for line feeds
Jeremy Posted December 8, 2020 Author Posted December 8, 2020 @Victor so for somethings it seems to work e.g. where is escapes quotes But there is nothing to signify new lines etc, is there of getting this to work? As currently this creates JSON that is not formatted correctly and fails when 'reading' it.
Victor Posted December 8, 2020 Posted December 8, 2020 @Jeremy could be the case the code behind the node does not "interpret" escape characters, so it displays them as raw values, while it formattes the new lines... there isn't any way to alter how the output param value is returned on this node... and unlikely this functionality (node) will be amended given that a) it's an experimental functionality and b) will be at some point deprecated and removed...
Jeremy Posted December 8, 2020 Author Posted December 8, 2020 @Victor how would you create a json file and output that doesn't use experimental functionality?
Victor Posted December 8, 2020 Posted December 8, 2020 Depends on what you using it for, what data...maybe @Steve G can have more insight when it comes to APIs and integrations...
Jeremy Posted December 15, 2020 Author Posted December 15, 2020 @Steve G do you know of a way to get this information out of Service Manager via an integration?
Steve G Posted December 21, 2020 Posted December 21, 2020 Hi @Jeremy, Apologies for the late response on this. There's a utility node to escape strings ready to be inserted into JSON, this is what you need to use on the field in question before using the result of this node in your JSON: So without pushing the description through this node, and adding it in its vanilla state to the JSON, your output is (as you have seen): But preparing the string with the workflow utility before adding it to your JSON, and you get the desired result: Let me know if this helps. Cheers, Steve 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now