skip to Main Content

I’m trying to add a new line in a concat in azure logic apps. but it only adds the new line as a string instead.

My goal is to add an array of object I get into a word doc. but it doesnt add a new line but actually adds the characters.

enter image description here

This is how I’m implementing this.

enter image description here

enter image description here

I have tried with <br> and n

2

Answers


  1. {
    "concatenatedText": "@concat(‘Line 1’, ‘n’, ‘Line 2’, ‘n’, ‘Line 3’)"
    }

    Login or Signup to reply.
  2. How to add a New Line in Azure Logic app, concat method?

    I have reproduced in my environment and below is expected results:

    Design:

    enter image description here

    Here you can add new line by creating a variable with new line like just pressing enter in value(of Initialize variable action).

    Then the conact statement:

    concat(items('For_each')['Firstname'],variables('newline'),items('For_each')['Lastname'],variables('newline'),items('For_each')['Whatname'])
    

    Output:

    enter image description here

    enter image description here

    Code view:

    {
        "definition": {
            "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
            "actions": {
                "For_each": {
                    "actions": {
                        "Compose": {
                            "inputs": "@concat(items('For_each')['Firstname'],variables('newline'),items('For_each')['Lastname'],variables('newline'),items('For_each')['Whatname'])",
                            "runAfter": {},
                            "type": "Compose"
                        }
                    },
                    "foreach": "@body('Parse_JSON')",
                    "runAfter": {
                        "Initialize_variable": [
                            "Succeeded"
                        ]
                    },
                    "type": "Foreach"
                },
                "Initialize_variable": {
                    "inputs": {
                        "variables": [
                            {
                                "name": "newline",
                                "type": "string",
                                "value": "n"
                            }
                        ]
                    },
                    "runAfter": {
                        "Parse_JSON": [
                            "Succeeded"
                        ]
                    },
                    "type": "InitializeVariable"
                },
                "Parse_JSON": {
                    "inputs": {
                        "content": "@triggerBody()",
                        "schema": {
                            "items": {
                                "properties": {
                                    "Firstname": {
                                        "type": "string"
                                    },
                                    "Lastname": {
                                        "type": "string"
                                    },
                                    "Whatname": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "Firstname",
                                    "Lastname",
                                    "Whatname"
                                ],
                                "type": "object"
                            },
                            "type": "array"
                        }
                    },
                    "runAfter": {},
                    "type": "ParseJson"
                }
            },
            "contentVersion": "1.0.0.0",
            "outputs": {},
            "parameters": {},
            "triggers": {
                "manual": {
                    "inputs": {
                        "schema": {}
                    },
                    "kind": "Http",
                    "type": "Request"
                }
            }
        },
        "parameters": {}
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search