Azure / LogicAppsUX

https://learn.microsoft.com/azure/logic-apps
MIT License
76 stars 81 forks source link

Dynamic Parameters with no new elements added results into default textfield #4119

Closed siddharth-ms closed 5 months ago

siddharth-ms commented 8 months ago

Describe the Bug with repro steps

  1. [Internal] Open sid-sap-testbox.ui-test in BTS4
  2. Create [RFC] Call function in SAP in-app action
  3. Set the Input Type to Custom
  4. Then select the optional RFC Name, and set it as STFC_CONNECTION
  5. A dynamicInvoke call is made which returns:

json { "response": { "body": { "type": "object", "properties": { "body": { "type": "object", "properties": { "REQUTEXT": { "type": "string", "title": "REQUTEXT", "maxLength": 1, "x-ms-visibility": "important" } }, "required": [ "REQUTEXT" ] } }, "required": [ "body" ], "default": {} }, "statusCode": "OK" } }

  1. Now select the optional RFC Name, and set it as RFC_PING which doesn't need any new parameter. We want it to set body as empty object {}
  2. A dynamicInvoke call is made which returns body with no parameters {}:

json { "response": { "body": { "type": "object", "properties": { "body": { "type": "object", "properties": {}, "required": [] } }, "required": [ "body" ], "default": {} }, "statusCode": "OK" } }

  1. This creates a new body parameter. But we want a body parameter which has no inner parameter. basically generating body as empty object like {}

image

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

Yes

Workflow JSON

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "Compose": {
                "inputs": "ECHO TESXT: @{body('[RFC]_Call_function_in_SAP')?['content']?['ECHOTEXT']}\nOTHER: @{body('[RFC]_Call_function_in_SAP')?['content']?['RESPTEXT']}",
                "runAfter": {
                    "[RFC]_Call_function_in_SAP": [
                        "SUCCEEDED"
                    ]
                },
                "type": "Compose"
            },
            "[RFC]_Call_function_in_SAP": {
                "inputs": {
                    "parameters": {
                        "body": {
                            "IV_TRTYP": "1102"
                        },
                        "inputBodyType": "Custom",
                        "outputBodyType": "XML",
                        "rfcGroupFilter": "*",
                        "rfcName": "RFC_PING"
                    },
                    "serviceProviderConfiguration": {
                        "connectionName": "sap",
                        "operationId": "callRfc",
                        "serviceProviderId": "/serviceProviders/sap"
                    }
                },
                "runAfter": {},
                "type": "ServiceProvider"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "triggers": {
            "When_a_HTTP_request_is_received": {
                "kind": "Http",
                "type": "Request"
            }
        }
    },
    "kind": "Stateful"
}

Screenshots or Videos

No response

Browser

Edge

Additional context

No response

preetriti1 commented 5 months ago

@siddharth-ms - You need to set the default property at the parameter level, you set it in response body, peer to highlighted type below. image