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 / Error for Fields that ...
Power Apps
Unanswered

Error for Fields that Need to Be Co-Populated

(0) ShareShare
ReportReport
Posted on by

Hi all,

 

I am wondering if anyone could think of a straightforward solution before I really get into the weeds here. I have a form and a patch button. There are 3 fields in the form that must be co-populated. That is, if one of those items contains data, the rest should contain data as well. However, the form should still be patchable if those fields are all blank, and I should add that those fields are only a small subset of the entire form. I was thinking of creating a variable and adding one to it if one of the fields on the screen was not blank. Then I could add a patch condition checking if the total value of that variable is equal to 0 or 3.

 

Thanks

 

Categories:
  • Ethan_009 Profile Picture
    4,840 Moderator on at

    Hi @shuhn1229 ,

     

    You can try something like this:

    With(
     {
     Condition1: (IsBlank(Field1) && IsBlank(Field2) && IsBlank(Field3)) || (!IsBlank(Field1) && !IsBlank(Field2) && IsBlank(Field3))
     }
     If(
     Condition1 = true,
     //Patch function containing data of 3 fields
     ,
     //Patch function without those 3 fields
     )
    )

     

    Hope this format helps

  • cmitchener Profile Picture
    on at

    I haven't played around with forms, but this is usually the type of code I use (I check the length of the field instead of checking for empty/blank because I find it to be more accurate with less code, but you can do whatever you want):

     

     

     

    If(

         //check if all fields are empty OR all fields are NOT empty

         Or(

              And(

                   Len(Field1.Text) = 0,

                   Len(Field2.Text) = 0,

                   Len(Field3.Text) = 0

              ),

              And(

                   Len(Field1.Text) > 0,

                   Len(Field2.Text) > 0,

                   Len(Field3.Text) > 0

              )

         ),

         [no error],

         [error]

    );

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 396 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 323

#3
WarrenBelz Profile Picture

WarrenBelz 193 Most Valuable Professional

Last 30 days Overall leaderboard