web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Flow is not triggered from Custom Page OnStart event

(0) ShareShare
ReportReport
Posted on by 103

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.

I have the same question (0)
  • Suggested answer
    Pradeep Rai Profile Picture
    5,489 Moderator on at

    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/

  • Suggested answer
    Haig Liu Profile Picture
    Microsoft Employee on at

    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/

  • MZ_980 Profile Picture
    103 on at

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

  • Suggested answer
    MZ_980 Profile Picture
    103 on at

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

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

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 45 Most Valuable Professional

#2
iampranjal Profile Picture

iampranjal 36

#3
Satyam Prakash Profile Picture

Satyam Prakash 31

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans