Newlines in dynamic content
When writing dynamic content, particularly when concatenating strings, I need newlines to be included in the resulting string.
That's a terrible summary, but here's my real example. I have an HTTP dataset which requires a multi-line header
Where <GUID> is defined by a parameter. Before I parameterized that value, I put in a single literal GUID, so the newline I typed into the Additional Headers field worked fine. Now that it's parameterized, I have a dynamic content expression like
I'd expect the resulting string to have the Accept and Installation headers on separate lines, as in my sample headers, but they're all on one line with the \n literal like so:
I hit this the other day - you can use the REST connector which allows you to enter multiple headers. However, REST only allows "Accepts json/application" you can't override that, thus I had to switch back to HTTP connector.
Thank you very much @Jason. The base64 encoded string works.
Russ R commented
This worked, so I'm adding votes to this
Jason Conner commented
So far, the only workaround I've come up with is using base64 encoded strings to encode the literal portion with the newline character, then decode that in the dynamic content expression and concatenate it with the parameter.
A similar approach, using only a base64 encoded newline, may be possible, but I haven't tested it yet.
@concat('Accept:application/json', base64ToString('Cg=='), 'Installation:', dataset().installationId)
The base64ToString('Cg==') is sort of like using Environment.NewLine in format or interpolated strings, but it's far from an intuitive approach.