2

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"
        ]
    }
}
TylerH
  • 20,799
  • 66
  • 75
  • 101
farid wahyu
  • 81
  • 1
  • 11

1 Answers1

0

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.

SeaDude
  • 3,725
  • 6
  • 31
  • 68
  • Dear @seadude, thanks for your response, in my MS Flow, there is no error raised up. the flow successfully runned. I have attached the results of MS Flow – farid wahyu May 21 '20 at 05:49
  • Ok. Is there an error in PowerApps where you are calling ClearCollect? Your collection is likely nested JSON. Add a screenshot of your Collection (View/Collections). – SeaDude May 21 '20 at 06:00
  • yes, the result of flow.. nested JSON. ok, The screenshot is in the attachment – farid wahyu May 21 '20 at 06:31
  • See my edited answer. Just add a `.` at the collection or at the gallery to "dig" into the nested json response. – SeaDude May 21 '20 at 06:48
  • i am sorry, still not working. the problem is value of response (Ms Flow Action) cannot stored into collection in powerapps. are u have any solution? – farid wahyu May 21 '20 at 07:19
  • Is that successful Flow run in "Results of Flow2" screenshot the call from powerapps or from YOUR TESTING in Flow? – SeaDude May 21 '20 at 07:38
  • All action in my Flow are successfully executed without error. see attachment (ALL action in Flow are successfully) . – farid wahyu May 21 '20 at 07:44
  • I'm tapped! Other than the recommendations above, I can't think of any other variables that would affect the Collection from Flow. – SeaDude May 21 '20 at 07:50
  • 1
    i am sorry @seaDude, i already figured out the solution, i use the SP for the query String. for the parameters of SP, send from powerapps. thanks for your response. but i already found something about the response in MS Flow. if we use action "Execute a sql query (V2)", the body at the Response / Request have no "Resultset.Table1" .. see attachment "Execute a Sql Query (v2)" if we use action "Execute Stored Procedure (V2)", the body at the Response / Request hace "ResultSet.Table1".. see attachment "Execute Stored Procedure (v2)" – farid wahyu May 21 '20 at 08:11