Share via


Action content : how to insert a carriage return?

Question

Thursday, December 3, 2015 9:17 PM

Hello,

I use Logic App with an FTP Connector trigger and an Azure Blob Connector action to upload and store csv files in Azure Blobs.

I would need to insert a header line in the content of each blob, but I do not know how to define a carriage return at the end of the first line - for instance, the code below with \r\n doesn't work to break the line.

"BlobContent": {
                        "Content": "col1,col2,col3,col4,col5,col6,col7,col8,col9 \r\n @{triggers().outputs.body.Content}",
                        "ContentTransferEncoding": "None"
                    }

Can you please help?

Thank you.

Stephane

All replies (3)

Thursday, December 3, 2015 10:14 PM

I have found a solution myself : Editing the logic app via "code view" (not the designer) and inserting the following sequence in the content string: \r\n.

Note: When using the designer, the sequence is automatically transformed to \r\n.

Now, I would like to know if this approach is correct and reliable on the long term with Logic App?

Thank you

Stephane


Tuesday, December 15, 2015 2:50 PM | 1 vote

I have found a solution myself : Editing the logic app via "code view" (not the designer) and inserting the following sequence in the content string: \r\n.

Note: When using the designer, the sequence is automatically transformed to \r\n.

Now, I would like to know if this approach is correct and reliable on the long term with Logic App?

Thank you

Stephane

I would expect things to change when the new designer comes out next year. But I expect 97% of the changes to be for the better. So something might change here with this but as long as nobody edits your logic app via the designer, I'd expect this to probably be reliable at least until then.

Note: I'm just a dev and not at Microsoft. I know nothing authoritative in this area. I'm just sharing my opinion with you. :)

-Jax


Tuesday, April 7, 2020 4:43 AM

I managed to bypass the escape character for carriage return by creating string variable --> setting default value to \n which you can achieve by hitting enter or updating the code.

"Newline_(carrage_return)": {
               "inputs": {
                    "variables": [
                        {
                            "name": "Newline",
                            "type": "string",
                            "value": "\n"
                        }
                    ]
                }

Once you have this variable with only \n you can use it in concat('Level 55',variable(Newline),'Brown Ave')