PowerApp and Microsoft flow are well integrated and helps people and businesses to create custom solutions without having to go to through length software development process.
PowerApp – A service for creating, sharing, and using custom business apps on web or mobile platforms. PowerApp has built-in connectors to Microsoft platforms like Office 365, SQL Server, and Dynamics 365 and its visual designer makes it easy to build apps without writing code.
When connected with Dynamics 365, PowerApp automatically creates 3 screens for you: BrowseScreen, DetailScreen and EditScreen as shown below:
For more details on how to connect to Dynamics 365 from PowerApp, you can refer Here
Microsoft Flow – A service for creating workflows that automate processes across apps and services. A flow gets executed based on a trigger. Once the trigger is identified, the flow will run a series of steps that can include conditional logic. The trigger can be an application event, such as the creation of a new lead in Dynamics 365 or a file created in SharePoint, or the click of a button in a PowerApp application.
Note: Microsoft Flow is similar to Logic Apps but a lighter version where you cannot code to create custom components. Microsoft Flows can be created and executed in web browser as well as mobile app whereas Logic apps are supported in browser and visual studio.
Let’s create a simple mobile app using PowerApp which uses Microsoft Flow to create a Lead in Dynamics 365
- Login to PowerApp web portal or desktop app. I will be using desktop app
- Click on New -> Create New App -> Select Phone Layout Blank App template
- PowerApp will automatically add one blank screen. Click on Insert and add textboxes, labels and buttons as below:
- Provide appropriate names (double click on names to edit) to text boxes – These names will be helpful to pass parameters to Microsoft flow.
- Once screen is designed, we need to configure Microsoft Flow to be run on “Create Lead” button click.
- Select button and click “Flows” under Action menu
- Data pop up will appear, select “+ Create a new flow” which will redirect you to Microsoft flow web portal
- Flow will automatically add PowerApp component as a trigger. Click on + New Step and select “Add an action”
- Connect to Dynamics 365 and provide organization name and entity name, in my case it would be Leads
- As you select entity name, it will display all attributes. In order to set values in flow from PowerApp, select attribute and click on Add dynamic content and select Ask in PowerApps. This way while configuring Microsoft flow in PowerApp on button click, you will be asked to pass on required parameters.
- Save your flow and you will see this flow in PowerApp right away. Select flow you just created on onSelect action of button and pass parameters as required. PowerApp intellisense will help you to pass correct parameters as shown below:
- Click on Preview button on top right corner to run the app. App will be launched. Enter all values and click on Create Lead Button
- If you check Microsoft flow executions in Microsoft flow web portal, you will see flow is triggered
- And finally, you will have Lead created in Dynamics 365