Start a flow in a canvas app (retired)
You can use Power Automate to create logic that performs one or more tasks when an event occurs in a canvas app. For example, configure a button so that, when a user selects it, an item is created in a list created using Microsoft Lists, an email or meeting request is sent, a file is added to the cloud, or all of these. You can configure any control in the app to start the flow, which continues to run even if you close Power Apps.
When a user runs a flow from within an app, that user must have permission to perform the tasks that are specified in the flow. Otherwise, the flow will fail.
Enable classic Power Automate experience
By default, the new Power Automate pane is enabled by default. To use the classic Power Automate experience to create a flow, will need to switch back to the old experience manually.
It’s recommended that you use the Power Automate pane to create a flow. The classic Power Automate experience should only be used for troubleshooting. The classic experience will be retired soon and won't be available.
Select Settings at the top.
Select Upcoming features.
Under the Retired tab, select Enable Classic Power Automate pane to set the toggle to On.
- Sign up for Power Apps.
- Learn how to configure a control.
- A SharePoint site with two lists.
- List RepairShop contains Title, and ContactEmail columns.
- List Assets contains Title, AssetType, and RepairShop columns. The AssetType column is a choice column with choices such as "Desktop", "Laptop".
- The RepairShop column in Assets list is a lookup column that gets values from the ContactEmail column in RepairShop list.
- Create a few items in the RepairShop list for sample contacts.
Create a flow
In this section, you'll create a flow using Power Automate that creates an item in a list using the input value for the list column from an app created using Power Apps. You'll create the app that uses this flow in the next section.
Sign in to Power Apps.
On the left-pane, select Flows.
Select + New flow > Instant cloud flow.
Enter flow name, such as FlowInApp.
Under Choose how to trigger this flow, select Power Apps.
Select + New step.
Under Choose an operation, search for or select SharePoint connector.
Search for, or select Create item action.
For Site Address, enter or choose your SharePoint site that has the lists Assets and RepairShop.
For List Name, select the Assets list.
For Title, choose Ask in Power Apps from Dynamic content tab. The action automatically updates to Createitem_Title.
Choose values for AssetType Value, and RepairShop Id of your choice.
Add a flow to an app
In this section, you'll learn about creating an app using Power Apps that uses the flow created in the earlier section. The app uses text entered in a text box when the button is selected to trigger the flow to create an item in the selected list.
Create a blank canvas app with a name such as AppWithFlow.
Select + (Insert) on the left-pane.
Select Text input control.
Select Button control.
On the canvas, move the button control below the text input control.
Select Action menu at the top, and then select Power Automate.
Adding flow to the selected control or component clears out any existing formula for the chosen property. For example, when you add a flow to a button's OnSelect property that has a complex formula, the flow addition clears out this formula. Ensure you make a copy of the formula before adding the flow. However, this behavior is different when adding flow with Power Automate pane enabled. More information: Reference a flow
Alternatively, if you've enabled the "Enable Power Automate Pane" preview feature, you can chose your flow from the left-pane inside Studio.
More information: Use Power Automate pane (preview)
In the formula bar, remove the formula for the selected OnVisible property.
Select the text input control.
From the top-left side of the screen, select the property list drop-down, and then select the Default property.
In the formula bar, change the default property value from
"Enter Asset Title".
Select the button control.
From the top-left side of the screen, select the property list drop-down, and then select the Text property.
In the formula bar, change the text property value from
From the top-left side property list, select the OnSelect property for the button.
Enter the following formula in the formula bar.
In this formula, FlowInApp is the name of the flow you added using Power Automate. The .Run specifies the flow to execute. The flow executes with TextInput1 text input control added to this canvas, with the value entered in this text box (.Text).
In other words, when this button is selected, the app will run the flow with the value from the text input control, passing the text value to the flow to execute. And the flow will create the list item with this text input value along with rest of the selection inside the flow configuration.
Save and publish the app.
Test the flow
Now that you have both the flow, and the app created, you'll run the app and verify the creation of an item inside the selected list.
In Power Apps, select Apps, and then, select the AppWithFlow app.
Enter a value in the text input box, and then select Create Asset.
Verify that the item is created in your list.
Now that you've created a sample app that runs a flow and adds item inside a list, you can create more complex applications that interact with Power Automate and manipulate data inside various data sources.
Submit and view feedback for