Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Suggested answer

Validate creating record in Dataverse table from a model-driven app, using a Power Automate flow.

(1) ShareShare
ReportReport
Posted on by 5
I have this model-app driven app and I'm validating for special conditions to decide whether or not to save the record, using a Power Automate flow. Conditions work fine and I was able to make flow triggered appropriately when creating record. And when appropriate conditions (validations) are not met, I've tried a couple of approaches as found in forums:
 
* Use a Return response to PowerApps action
* Terminate the flow
 
which should namely prevent the add record action to finish.. But although I can see flow is indeed executed, and terminated, Power App will still save the record. Being a model-driven app, is there a way to achieve this sort of validation? I used Power automate as last resort after trying with calculated fields, but it didn't work and now I'm stuck. 
 
Appreciate the help.
 
 
Categories:
  • DH-11100057-0 Profile Picture
    5 on at
    Validate creating record in Dataverse table from a model-driven app, using a Power Automate flow.
    Thanks so much for suggestion. I'm pretty new to Power Apps and Power Automate but I think what you say is exactly what's happening (app and flow working asynchronously). So in my understanding, yes I'm kind of married to the flow, but just because I wasn't able to find another way to validate creating a record by finding out whether another record exists or not in the same table meeting specific conditions (and that's not a simple duplicate validation, which I already enabled as well). Maybe I'm just not doing looking into the right place.
     
    Just complementing what I want to achieve, if this was a MS Access form validation, I'd be running a simple query over same table just before saving the current record. If any result found, cancel event to save record (DO NOT save record), otherwise, go ahead and save it.  I know it's simplistic, but you get the idea.
     
    I thought of somehow replacing command bar Save&Close button with one of my own where I could trigger flow in sequence (synchronously), but it seems like being a model-driven app, button is not customizable and can't be hidden. Or at least I wasn't able to find out how to do that. 
     
     
     
    I agree the simplest would be to perform validation in PowerApps but, would you please provide some ideas on how could I do that sort of validation from inside the PowerApp itself? 
     
     
  • Suggested answer
    abc 123 Profile Picture
    784 Super User 2025 Season 1 on at
    Validate creating record in Dataverse table from a model-driven app, using a Power Automate flow.
    I'd have to expect that the actions of calling the Flow, and then the Save, although sequential in the code, would work asynchronously. So, the Flow fires, then the App code goes to the next step, and fires the Save immediately, not caring that the Flow is executing. 
     
    If you're married to the Flow, then maybe have a flag variable that enable/disables the Save button until the Flow is complete. (I don't like this, as Flow can take several minutes to trigger, and then you'd have to have really great error handling to ensure it doesn't hang up and time up, leaving the form user perplexed as to what's taking so long.)
     
    I'd think that you'd need to perform the validations in the PowerApp, and then disable/enable the Save button based on the user entries in the form, for the best enduser experience.
     
     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,587 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,928 Most Valuable Professional

Leaderboard