none
How to insert "CRLF" in logic apps when concatenate two fields? RRS feed

  • Question

  • In input i have address1 and address 2, while sending it should return with "CRLF" between address1 and address2. If address2 is empty shouldn't return "CRLF" in logic apps.

    Input :

    {

    "Address1": "XXXX",

    "Address2": "XXXX"

    }

    Output:

    "Add": "address1\r\naddress2"

    When i tried above method, in output it looks like  XXXX\r\nYYYY

    Input:

    Output:



    Vinoth

    Wednesday, September 11, 2019 7:47 AM

All replies

  • Hello Vinoth,

    Please see the below sample from my test:

    Code View:


    {
        "definition": {
            "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
            "actions": {
                "Compose": {
                    "inputs": {
                        "Address1": "XXXX",
                        "Address2": "YYYY",
                        "Retailer Name": "Name"
                    },
                    "runAfter": {},
                    "type": "compose"
                },
                "Response": {
                    "inputs": {
                        "body": {
                            "Billing Street": "@{outputs('Compose')?['Address1']}|| @{outputs('Compose')?['Address2']}"
                        },
                        "statusCode": 200
                    },
                    "kind": "http",
                    "runAfter": {
                        "Compose": [
                            "Succeeded"
                        ]
                    },
                    "type": "Response"
                }
            },
            "contentVersion": "1.0.0.0",
            "outputs": {},
            "parameters": {},
            "triggers": {
                "manual": {
                    "inputs": {
                        "schema": {}
                    },
                    "kind": "Http",
                    "type": "Request"
                }
            }
        }
    }


    Wednesday, September 11, 2019 9:55 AM
    Moderator