LogicAppsUX icon indicating copy to clipboard operation
LogicAppsUX copied to clipboard

new line character broken when used in editor

Open SquirrelAssassin opened this issue 2 years ago • 12 comments
trafficstars

Describe the Bug with repro steps

Make a new variable. try something like a value of array(split(variables('something'), '\n'))

when you save it, the code will change it to '\\n'

What type of Logic App Is this happening in?

Standard (Portal)

Are you using new designer or old designer

New Designer

Did you refer to the TSG before filing this issue? https://aka.ms/lauxtsg

No

Workflow JSON

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "For_each": {
                "actions": {
                    "Parse_JSON": {
                        "inputs": {
                            "content": "@items('For_each')",
                            "schema": {
                                "properties": {
                                    "action_type": {
                                        "type": "string"
                                    },
                                    "count": {
                                        "type": "integer"
                                    },
                                    "device_id": {
                                        "type": "string"
                                    },
                                    "device_name": {
                                        "type": "string"
                                    },
                                    "dry_run": {
                                        "type": "boolean"
                                    },
                                    "executable_file_size": {
                                        "type": "integer"
                                    },
                                    "executable_name": {
                                        "type": "string"
                                    },
                                    "executable_path": {
                                        "type": "string"
                                    },
                                    "guid": {
                                        "type": "string"
                                    },
                                    "id": {
                                        "type": "string"
                                    },
                                    "occurrence_date": {
                                        "type": "string"
                                    },
                                    "reason": {
                                        "type": "string"
                                    },
                                    "tenant_id": {
                                        "type": "string"
                                    },
                                    "threat_id": {
                                        "type": "string"
                                    },
                                    "type": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        },
                        "type": "ParseJson"
                    },
                    "Send_Data": {
                        "inputs": {
                            "body": "@{body('Parse_JSON')}",
                            "headers": {
                                "Log-Type": "Halcyon"
                            },
                            "host": {
                                "connection": {
                                    "referenceName": "azureloganalyticsdatacollector-2"
                                }
                            },
                            "method": "post",
                            "path": "/api/logs"
                        },
                        "runAfter": {
                            "Parse_JSON": [
                                "SUCCEEDED"
                            ]
                        },
                        "type": "ApiConnection"
                    }
                },
                "foreach": "@variables('a1')",
                "runAfter": {
                    "Initialize_variable": [
                        "SUCCEEDED"
                    ]
                },
                "type": "foreach"
            },
            "Initialize_variable": {
                "inputs": {
                    "variables": [
                        {
                            "name": "a1",
                            "type": "array",
                            "value": "@array(split(triggerBody(),'\n'))"
                        }
                    ]
                },
                "runAfter": {},
                "type": "InitializeVariable"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "triggers": {
            "When_a_HTTP_request_is_received": {
                "inputs": {
                    "schema": {
                        "properties": {
                            "action_type": {
                                "type": "string"
                            },
                            "count": {
                                "type": "integer"
                            },
                            "device_id": {
                                "type": "string"
                            },
                            "device_name": {
                                "type": "string"
                            },
                            "dry_run": {
                                "type": "boolean"
                            },
                            "executable_file_size": {
                                "type": "integer"
                            },
                            "executable_name": {
                                "type": "string"
                            },
                            "executable_path": {
                                "type": "string"
                            },
                            "guid": {
                                "type": "string"
                            },
                            "id": {
                                "type": "string"
                            },
                            "occurrence_date": {
                                "type": "string"
                            },
                            "reason": {
                                "type": "string"
                            },
                            "tenant_id": {
                                "type": "string"
                            },
                            "threat_id": {
                                "type": "string"
                            },
                            "type": {
                                "type": "string"
                            }
                        },
                        "type": "object"
                    }
                },
                "kind": "Http",
                "type": "Request"
            }
        }
    },
    "kind": "Stateful"
}

Screenshots or Videos

No response

Browser

edge

Additional context

No response

AB#25554750

SquirrelAssassin avatar Oct 20 '23 21:10 SquirrelAssassin

@preetriti1 this seems to also have the same interaction in Old designer, do you know if we should be supporting this, or if there would be consequences supporting this?

Eric-B-Wu avatar Oct 23 '23 14:10 Eric-B-Wu

❌ There was a problem linking to Azure Boards work item(s):

  • 25554750

Please check the IDs and try again using the AB# syntax. Learn more

azure-boards[bot] avatar Feb 06 '24 16:02 azure-boards[bot]

❌ There was a problem linking to Azure Boards work item(s):

  • 25554750

Please check the IDs and try again using the AB# syntax. Learn more

azure-boards[bot] avatar Feb 06 '24 16:02 azure-boards[bot]

❌ There was a problem linking to Azure Boards work item(s):

  • 25554750

Please check the IDs and try again using the AB# syntax. Learn more

azure-boards[bot] avatar Feb 06 '24 16:02 azure-boards[bot]

❌ There was a problem linking to Azure Boards work item(s):

  • 25554750

Please check the IDs and try again using the AB# syntax. Learn more

azure-boards[bot] avatar Feb 06 '24 16:02 azure-boards[bot]

❌ There was a problem linking to Azure Boards work item(s):

  • 25554750

Please check the IDs and try again using the AB# syntax. Learn more

azure-boards[bot] avatar Feb 06 '24 16:02 azure-boards[bot]

❌ There was a problem linking to Azure Boards work item(s):

  • 25554750

Please check the IDs and try again using the AB# syntax. Learn more

azure-boards[bot] avatar Feb 06 '24 16:02 azure-boards[bot]

❌ There was a problem linking to Azure Boards work item(s):

  • 25554750

Please check the IDs and try again using the AB# syntax. Learn more

azure-boards[bot] avatar Feb 06 '24 17:02 azure-boards[bot]

❌ There was a problem linking to Azure Boards work item(s):

  • 25554750

Please check the IDs and try again using the AB# syntax. Learn more

azure-boards[bot] avatar Feb 06 '24 17:02 azure-boards[bot]

❌ There was a problem linking to Azure Boards work item(s):

  • 25554750

Please check the IDs and try again using the AB# syntax. Learn more

azure-boards[bot] avatar Feb 06 '24 19:02 azure-boards[bot]

@Eric-B-Wu No this is not intended and should be fixed.

preetriti1 avatar May 02 '24 04:05 preetriti1

Hi, any update on this? Would be nice with a fix!

JoakimNylundOP avatar Sep 18 '24 08:09 JoakimNylundOP

For this issue control characters will likely continue to be escaped. This is necessary because otherwise we wouldn't be able to differentiate between when a control character is being used and when not. If you need to handle a control character like "/n" this can be done by the Enter key which will be serialized as "/n"

Eric-B-Wu avatar Oct 26 '24 01:10 Eric-B-Wu

reopening due to popular request

Eric-B-Wu avatar Nov 15 '24 22:11 Eric-B-Wu