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 / The logic that used to...
Power Apps
Answered

The logic that used to work doesn't work now

(0) ShareShare
ReportReport
Posted on by

Hi,

I have a situation where I use a condition to check if the form has the required fields completed.

 

If(formName.Valid, 'run flows', false)

it used to work so that when the user did not enter the required data in the form, nothing happened, only the red controls with missing information were highlighted. If everything was ok, flow was started, which saved data to the sharepoint list.

 

 

Has anything changed recently in how form.valid works?

Categories:
I have the same question (0)
  • mmollet Profile Picture
    3,187 on at

    I dont use forms usually as I just make my own and use patch statements but you could try to use this: 

    https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-validate

     

    That being said I just checked my apps that use '.Valid' and they all seem to be working properly. Can you share an image of the error maybe? Here is my code for what I checked: If(Form1_1.Valid, SubmitForm(Form1_1)); It is standard practice to not put anything after submitform call but rather to put any functions that should be executed after it in the forms OnSuccess property to be executed when it is successfully submitted.

  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @ShockWave21,

     

    Is the aim to only run the flows when the Form record has successfully been submitted? In that case, running the flows in the OnSuccess of the Form control would be preferred.

     

    To my knowledge the Form.Valid property has not changed, it might be beneficial to double check all of the DataCard Required properties of the fields you'd expect to not be blank (should be true).

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

  • ShockWave21 Profile Picture
    on at

    @LaurensM @mmollet I can't use SubmitForm in my case because all save actions happen in flow.

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @ShockWave21,

     

    I don't use Forms that often, but to my knowledge the validation (red error messages) only takes place when you actually try to submit the form via SubmitForm() (affected by the Required property). This functionality can be changed, by manually adjusting the visible properties of those error labels or by adding custom errorlogging. FormName.Valid will return a true or false value depending on the validity of the form datacard values.

     

    I don't expect this to be best practice, but an easy ('lazy' 😉) way of validating the form could be:

    If(
     formName.Valid, 
     'run flows', 
     //Trigger error messages by trying to submit invalid data
     SubmitForm(formName)
    )

     

    That being said, there are a lot of ways of validating data before pressing the button - which I would highly recommend from a UI/UX and best practice standpoint over the code above. The following guides should provide some more insight into the possibilities:

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

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!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 94

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard