Search code examples
httprequestazure-logic-appspower-automate

How to pass string from PowerAutomate to Logic Apps?


I want to send a string to Logic Apps from Power Automate. In my company there are two set ups like this, so I know it's doable. In the logic app, I seem to be able to somehow pass it (name: Group), as one can see in the initialize variable module: enter image description here

In the Power Automate flow, I try to pass the string "G2" like this: enter image description here

However, the string is always empty:

enter image description here

I really tried to rebuild this set up like the other apps we have, but haven't been successful so far. Anyone has experience in that matter?


Solution

  • After reproducing from my end you can send the string utilizing the body of the HTTP Trigger using a JSON body. Below is the flow in my PowerAutomate.

    enter image description here

    Here is the code in my Logic apps

    enter image description here

    RESULT:

    enter image description here

    For reproducing in your environment you can use the below codeview in your logic apps

    {
        "definition": {
            "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
            "actions": {
                "Initialize_variable": {
                    "inputs": {
                        "variables": [
                            {
                                "name": "Group",
                                "type": "string",
                                "value": "@triggerBody()?['Group']"
                            }
                        ]
                    },
                    "runAfter": {},
                    "type": "InitializeVariable"
                }
            },
            "contentVersion": "1.0.0.0",
            "outputs": {},
            "parameters": {},
            "triggers": {
                "manual": {
                    "inputs": {
                        "schema": {
                            "properties": {
                                "Group": {
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "kind": "Http",
                    "type": "Request"
                }
            }
        },
        "parameters": {}
    }