Power Apps allows users to create and publish mobile apps through an easy to use the web-based tool without any coding. This enables non-developers to publish apps for the whole team.
Power BI provides integration with Power Apps and now allows users to embed Power Apps in their reports. Data can be passed from Power BI reports to Power Apps enabling further actions based on the data. This answers the demand of business users for making the data more actionable.
Several business scenarios require writing back to the original data source. For example, employee timesheet approvals or sales quota changes. Power Apps integrates the capability to write back seamlessly into the report.
Timesheet records are stored at the grain of the project by day in a timesheet table, and a timesheet status table has approval status for each week along with employee details. In this case, a Power App is embedded to update the timesheet status directly from the report.
To embed a Power App in the report, add the Power Apps for Power BI visual to the report workspace and choose the appropriate data fields that must be passed to the app.
The visual prompts the user to create a new app or use an existing Power App. Choose to create a new Power App, and it redirects to the Power BI web interface with a clean canvas.
The Power App canvas will have a dedicated dataset ‘PowerBIIntegration’, which consists of all the data fields passed on from Power BI.
This can be used to lookup values in the source table. The below syntax matches the first row of the timesheet_key column with the source table and retrieves the values.
The Edit Form component of Power Apps can be used to update a record in the source table. Employee name and time period are retrieved through the lookup, and approval status is altered to be approved or rejected. Clicking the ‘Submit’ button, submits the Power App form, and alters the record in the database.
The Power Apps Outlook connector can be used to connect to the Outlook email client to send an email. The email ID of the employee is retrieved from the table through lookup, and text input is provided for the user to input the email content, i.e., the reason for rejection. Below is the syntax for the button to take the above email and text as input and send the mail.
When the employee and time period are selected using the slicer at the top of the report, corresponding data is visualized in the report and the Power App on the right. A user can update the status to either approved or rejected from the dropdown and submit the status. Comments can be sent through the ‘Send Mail’ button at the bottom.
The Power Apps created for this report must first be shared with the end-users for them to access the reports.
This demonstrates how Power Apps provides the write-back capability to Power BI reports and makes the data actionable right from your dashboard.
Learn more about Microsoft Power BI services offerings from Visual BI solutions here.