Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Flow is not triggered from Custom Page OnStart event

(0) ShareShare
ReportReport
Posted on by 95

I have a flow that I'm trying to run from the Custom Page App OnStart event.  I'm creating a collection with the response from my flow:

ClearCollect(
    collection1,
    ForAll(
        Table(ParseJSON(flowname.Run().body)),
        {
            Field1Name: Text(Value.Field1Name),
            Field1ID: Text(Value.Field1Id),
            Field2Name: Text(Value.Field2Name),
            Field2ID: Text(Value.Field2Id)
        }
    )
);

The collection is created, but there is no data.  When I check the flow history, it says that it hasn't been run.  I've tried running this on the OnVisible event for the screen, but I also get the same result.  However, when I click a button with the same code, it works.  

 

My options are

  1. Trigger the flow from App OnStart (optimal)
  2. Trigger the flow from the Screen OnVisible (good)
  3. Trigger the flow by hiding the button and have either the App OnStart or Screen OnVisible event simulate the button OnSelect event.  (Hacky)
  4.  Trigger the flow from the visible button. (Last resort)

If there are other options, please let me know.  Otherwise, 1 or 2 would be preferred.

  • Suggested answer
    MZ_980 Profile Picture
    MZ_980 95 on at
    RE: Flow is not triggered from Custom Page OnStart event

    Hello.  I added the Custom Page and ran it from my app instead of preview and the flow was triggered.  Thanks for your help!

  • MZ_980 Profile Picture
    MZ_980 95 on at
    RE: Flow is not triggered from Custom Page OnStart event

    Thanks for responding.  I didn't try that option because of the latency added to loading my Custom Page.  

  • Suggested answer
    Haig Liu Profile Picture
    Haig Liu Microsoft Employee on at
    RE: Flow is not triggered from Custom Page OnStart event

    Hi MZ_980,

    Maybe it's just because of the preview:

    https://sachinbansal.blog/2018/05/22/powerapp-canvas-onstart-event-does-not-fire-in-app-preview/

  • Suggested answer
    Pradeep Rai Profile Picture
    Pradeep Rai 5,490 Super User 2024 Season 2 on at
    RE: Flow is not triggered from Custom Page OnStart event

    Hi,

    It is because of async behaviour i would suggest to go with 4 option.

    But can you try using wait as described below:
    https://debajmecrm.com/how-to-introduce-delay-or-wait-in-actions-in-power-apps-canvas-apps/

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans