1
votes

Scenario: Two Logic Apps. We'll call them Parent and Child.

Use Case: - Parent prepares a request for Child. - Parent invokes Child with request data. - Child has schema defined on Request trigger. - Child sends data received from Parent to an external API endpoint and gets the response, returning it as a Response action.

Issue: When calling Child using the Logic App action, each non-nullable parameter is there in the designer for Parent based on JSON schema in Child. However, the output of that Logic App action is just a Body, no Status Code.

enter image description here

When calling Child using POST endpoint URL from Child Request action, parameters are not visible so we have to compose the request, but Status Code is returned and accessible.

enter image description here

Question: Is there a way using the Logic App Action (first screenshot) to get the Status Code or must we use the HTTP request version?

Is there a way using Logic App action to specify values for the nullable parameters in the JSON schema?

If the answer is HTTP request version, how do we best define the URL so that it remains consistent between environments? DNS? APIM?

1

1 Answers

1
votes

I found what appears to be the only solution to this. It is rather counter-intuitive as it would seem a Logic App action should expose a statusCode output by default along with the body. But it doesn't.

In the parent Logic App which consumes the child Logic App, to get the status code returned by the child, you can initialize a variable following this pattern for the expression

outputs('<action-name>')['statusCode']

After you save, the designer makes it look like a first-class dynamic content variable even though it is not directly accessible in the dynamic content list, regardless of your variable type for some reason.

enter image description here