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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Triggering a Flow each...
Power Apps
Unanswered

Triggering a Flow each time a form is loaded (IsNew)

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi again powerusers!

 

I have a simple form for registering incoming and outgoing post. Each registration needs a unique ID based on YYYY.<random number> which I set using a variable which is set by calling a Flow.

 

I thought to be smart and set the variable upon loading the App, but as it seems this variable is not refreshed whenever you click on the "New" button again. Meaning all new list items get the same unique id as the first generated in this "session". Working with a button to calculate a new ID works just fine. 

 

How can I trigger the flow each time the form is loaded in New mode? 

 

Thanks!

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,943 Most Valuable Professional on at

    Hi @Anonymous ,

    On your New button set a Variable

    Set(varNew:true)

    On the OnSuccess of the New Form

    If(
     varNew,
     YourFlowName.Run( . . . . )
    )

    Also ensure if you have a cancel button from the New Form

    Set(varNew:false)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz 

     

    This would only trigger the flow to set the variable on pressing Save - correct? 

     

    My users need to see the variable value before pressing Save. Once they then click on "new" again, the variable has to be reset (meaning: the flow has to be run again) so it gets a new number.

     

    Thanks,

  • WarrenBelz Profile Picture
    154,943 Most Valuable Professional on at

    Hi @Anonymous ,

    I cannot see your model, but as you realise, a Flow has to be triggered by something done by the User. They will "see" the Variable as it is initiated on the New function, but you need to consider where to trigger the Flow if you do not want it OnSuccess.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz 

     

    Thanks. 

     

    So just to be clear, there is no way in PowerApps to trigger the flow each time the form is loaded, without having to refresh the page?

     

    Thanks,

  • WarrenBelz Profile Picture
    154,943 Most Valuable Professional on at

    @Anonymous ,

    What are you using to trigger the loading of the form? You could run the Flow from there, although to answer your specific question, a Form has no actual OnLoad event

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    You can trigger a flow in the App wherever there is a On... property, OnSelect of buttons, OnVisible of Screens, OnStart of App, OnSave of forms, and so on. So, when or where you want to trigger the flow to get the flow returned value, set the variable with triggering the flow, use the variable value. From your end for example, set OnSelect of an add button or icon to navigate to new item screen or NewForm an Edit form, then use the variable as the Default of a Text Input box within the form.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • hemrhk Profile Picture
    361 on at

    @Anonymous 

     

    You can trigger the flow on Screen "OnVisible" property

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard