Can't get a response value from Power Automate

Viewed 1178

I have a flow that executed in Power Apps and the result of Power Automate will store to collection, but after executing the flow, the collection still empty of rows.

Here is my code in Power Apps

ClearCollect(
    collTest,
    SORExcuteQueryString.Run(varStrQuery)
);

And this is my Flow

All action in Flow are successfully

Result of Flow

Result of Flow 2

collection

apps code

Execute a SQL Query

Execute Stored Procedure

and this is my Scheme of the response

    {
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "Area": {
                "type": "string"
            },
            "DADays": {
                "type": "integer"
            },
            "CustomerName": {
                "type": "string"
            },
            "SalesmanName": {
                "type": "string"
            },
            "ProductName": {
                "type": "string"
            },
            "QTY": {
                "type": "integer"
            },
            "UOM": {
                "type": "string"
            },
            "OpportunityNo": {
                "type": "string"
            },
            "ProductFamily": {
                "type": "string"
            }
        },
        "required": [
            "Area",
            "DADays",
            "CustomerName",
            "SalesmanName",
            "ProductName",
            "QTY",
            "UOM",
            "OpportunityNo",
            "ProductFamily"
        ]
    }
}
1 Answers

Power Automate (Flow) will show the Run History of each flow execution. Look at the history and determine:

  1. If it was Successful
  2. Expand each Action in Flow to look at the Inputs/Outputs and Query Strings

    2a. Are there any errors?

    2b. Is there any data in the response from SQL?

  3. If the Flow actions are successful, are there any errors in PowerApps where you instantiate the ClearCollect?

    3a. If so, correct the parameters you are passing Flow

  4. Click View/Collections and see if the Collection is nested JSON

    4a. If so, you have two options for accessing the data

    i. Use . (dot notation) to dig into the json when you create the collection.

    ii. Use . (dot notation) to dig into the json when you display the collection in a gallery

Example1:

ClearCollect(colTest,
    SORExecuteQueryString.Run(varStrQuery)
).items.properties

Example2: Set the gallery Items property to something like

colTest.items.properties
  1. As a last ditch effort, you can File/Save/Close PowerApps and reopen the app.

    5a. Sometimes this prompts an "Allow" popup that is required to get a response from a connector (usually only applies to Custom Connectors)

  2. Finally, if you're unable to find the problem using above, View/DataSources, select the Flow, remove it and re-add it to the PowerApp.

    6a. Usually only need this if you've changed your Flow "Ask in PowerApps" parameters.

    6b. Be careful here! When you choose a Button OnSelect (typically) to re-add the Flow, PowerApps will overwrite any code you have written there. Best to copy and paste the code from the OnSelect property then re-add the Flow to the button to avoid this.

  3. You might also check File/Settings/Advanced Settings for any SQL-related Preview/Experimental settings. Toggle these on/off during troubleshooting to see if that makes a diff.

Related