Power Apps: display stored procedure data in DataTable after button click

Viewed 268

I have just started using Power Platform (Power Apps). I recently tried to see data (via Google Sheets) in a data table which worked fine by attaching a data source (of Google Sheets) to a data table.

Now, what I am trying to do is:

  1. I added a button in my Test app

  2. On that button's onSelect, I am executing a stored procedure after successfully adding a SQL Server data source

  3. The code which I wrote in onSelect is this:

    MyStoredProcDataOnButtonClick.Run()
    
  4. Now, after this event is called, I want to showcase the result data from the stored procedure call in a data table

  5. In the data table, I am unable to see the data source (for that stored procedure)

How can I achieve this?

Any help/suggestions would be appreciated.

Note: I created a flow for this from Power Apps to execute a stored procedure on button click.

1 Answers

Add the SQL Connector to the PowerApp. Create a collection of the record(s) you need.

Example:

ClearCollect(colData,
    Filter(SQL_TABLE,
        whatever_column = whatever_value
    )
)

Set the Items property of a Gallery to colData. Add some Label controls to the Gallery template for the data you want to show. Like @strattonn said, the SQL Connector is premium. Though check the PowerApps license guide and search for "multiplexing". Your current PowerApp-to-Flow-to-SQL workflow may already require all of your PowerApps users to be premium licensed.

Related