Skip to main content

How to Run a Flow and Use Its Result in Power Apps

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

FlowName.Run() runs a flow from a canvas app and returns what the flow sent back, with each output as a field. Call it in a button's OnSelect, keep the result in a variable for the screen to show, and select that button from the screen's OnVisible so the data loads when the screen opens.

The example is the Waiting for Approval screen of the Overtime Timesheet app. Its Refresh button runs Get Waiting Approvals, which returns the overtime entries waiting for the approver as JSON text in an output named entries.

Prerequisites​

Step 1: Run the Flow in a Button's OnSelect​

Run() belongs in a property that runs when something happens, such as a button's OnSelect. Microsoft's Power Automate pane article uses the same place. The output is a field of the result:

The flow's output
GetWaitingApprovals.Run().entries

Step 2: Keep the Result in a Variable​

A screen's labels and gallery can't call a flow themselves, so the button stores what the flow returned in context variables (How to Use Context Variables in Power Apps with UpdateContext). The complete OnSelect:

btnRefreshWA → OnSelect
UpdateContext({ locIsLoadingWA: true });
With(
{ response: IfError(GetWaitingApprovals.Run(), Blank()) },
If(
IsBlank(response),
UpdateContext({ locLoadFailedWA: true });
Notify("The entries waiting for you couldn't be loaded. Select Refresh to try again.", NotificationType.Error),
UpdateContext({
locLoadFailedWA: false,
locEntriesWA: ForAll(
ParseJSON(response.entries),
{
ID: Value(ThisRecord.id),
Employee: Text(ThisRecord.employee),
Department: Text(ThisRecord.department),
StartTime: DateTimeValue(ThisRecord.startTime),
EndTime: DateTimeValue(ThisRecord.endTime),
BreakMinutes: Value(ThisRecord.breakMinutes),
SavedOn: DateTimeValue(ThisRecord.savedOn)
}
)
})
)
);
UpdateContext({ locIsLoadingWA: false })

What each part does:

Step 3: Load It When the Screen Opens​

In the screen's OnVisible, select the button, so opening the screen runs the same formula (How to Use the Select Function in Power Apps):

Waiting for Approval Screen → OnVisible
Select(btnRefreshWA)

One formula then serves both cases: opening the screen and selecting Refresh.

The Result​

For an approver with one entry waiting, the screen showed it after the flow answered:

The Waiting for approval screen with Back and Refresh in the header, saying 1 entry is waiting for your decision, with a note on where to approve or reject, and one card: Admin User, Mon 09/11/2026, 17:00 to 19:00, 2.00 hours, Radiology, Waiting since 10/11/2026 11:20

In Studio, selecting the screen in the tree ran its OnVisible, so the flow ran there too, under the maker's account.

Common Mistakes​

MistakeWhat happensDo this instead
Run() in a gallery's ItemsBehavior function in a non-behavior propertyRun it in OnSelect, store the result
Calling Run() twice in one formulaThe flow runs twiceWith keeps one result
IfError around UpdateContextIt doesn't catch the failureIfError around Run() (the fix)
No loading indicatorThe screen looks stuck while the flow runsA spinner on a loading variable

Troubleshooting​

SymptomLikely causeFix
.entries isn't offered after Run()The app has the flow's old definitionRefresh the flow in the app
Works for you, fails for othersThe flow isn't shared with themHow to Share a Flow with Run-Only Users in Power Automate
The screen stays emptyThe flow returned nothing, or the call failedCheck the flow's run history

FAQ​

Does the app wait for the flow?​

Yes. The formula continues once the flow has responded, which must happen within 120 seconds (How to Send Values Back to Power Apps from a Flow in Power Automate).

Can I pass values to the flow?​

Yes, if the flow's trigger has inputs: they go inside the brackets, in order, such as MyFlow.Run("value"). Microsoft warns that those values can be seen as network traffic, so the flow should check them. This flow takes none: it works out who's calling by itself.

Conclusion​

Run the flow with FlowName.Run() in a button's OnSelect, keep its result in a variable with a loading flag around the call, and select the button from OnVisible. The screen then shows the flow's answer whenever it opens or the user refreshes it.

Additional Resources​