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 / Making required fields...
Power Apps
Answered

Making required fields, that are then within a gallery

(0) ShareShare
ReportReport
Posted on by

Hello everyone, this is my code for my submit button:

If(ReviewpurposeDropdown_13.Selected.Value="Review purpose",Notify("Select the Review Purpose."),TextInput1_3.Text="",Notify("Select the Project Site."),InputDrawing_13.Text="",Notify("Input the Drawing Numbers."),
TextInput1_1.Text="",Notify("Input the Project Number."),Dropdown1_2.Selected.Value="",Notify("Enter an answer for all questions."))

 

The problem is with the underline and bolded code, that dropdown is within a Gallery, so if the first dropdown doesnt have anything selected, it will give the notification, however, if ANY of the other dropdowns dont have anything selected, the notifivation wont pop up, how do I make it take into consideration all the dropdowns instead of just the first one?

 

Also, I want to make it if any of these fields are populated AT ALL with any text, THEN the proceeding code block follows, how could I manage that?

 

Categories:
  • Verified answer
    BCBuizer Profile Picture
    22,899 Super User 2026 Season 2 on at

    Hi @Angel5 ,

     

    Try the below:

     

    If(
    	ReviewpurposeDropdown_13.Selected.Value="Review purpose",
    		Notify("Select the Review Purpose."),
    	TextInput1_3.Text="",
    		Notify("Select the Project Site."),
    	InputDrawing_13.Text="",
    		Notify("Input the Drawing Numbers."),
    	TextInput1_1.Text="",
    		Notify("Input the Project Number."),
    	!IsEmpty(Filter(Gallery.AllItems, GalleryDropdown1_2.Selected.Value="")),
    		Notify("Enter an answer for all questions.")
    )

     

    This filters all items in the Gallery (replace this name with the actual name of the gallery) and if any of the items has a blank value in GalleryDropdown1_2, the notification will be shown.

  • Angel5 Profile Picture
    on at

    This worked! but how do I resolve that when ALL of these fields are filled out, then the proceeding code happens?

     

  • Angel5 Profile Picture
    on at

    Solved it, had to put this whole if statement within another if statement, equaled the first statement to processcompleted=false and then the next block of code ran, thank you still!

     

  • BCBuizer Profile Picture
    22,899 Super User 2026 Season 2 on at

    Hi @Angel5 ,

     

    There's no need for another If function since you can then use the default behaviour in the existing If function:

     

     

    If(
    	ReviewpurposeDropdown_13.Selected.Value="Review purpose",
    		Notify("Select the Review Purpose."),
    	TextInput1_3.Text="",
    		Notify("Select the Project Site."),
    	InputDrawing_13.Text="",
    		Notify("Input the Drawing Numbers."),
    	TextInput1_1.Text="",
    		Notify("Input the Project Number."),
    	!IsEmpty(Filter(Gallery.AllItems, GalleryDropdown1_2.Selected.Value="")),
    		Notify("Enter an answer for all questions."),
    	<enter here what needs to be done if all criteria have been met>
    )

     

     

  • Angel5 Profile Picture
    on at

    Yeah but when you say <enter here what needs to be done if all criteria have been met> I understand that it would be the opposite, I want this process to happen if all these criteria AREN'T met, since it would mean that the user did in fact submit the fields.

     

  • BCBuizer Profile Picture
    22,899 Super User 2026 Season 2 on at

    Hi @Angel5 ,

     

    That is indeed the behaviour of the If function: the line "<enter here what needs to be done if all criteria have been met>", is what is executed if none of the above conditions are met. In the documentation this is referred to as the DefaultResult: https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-if#syntax

     

    Apologies for the confusion: I used the word criterium as the opposite of condition in the the If function: ReviewpurposeDropdown_13.Selected.Value is NOT "Review purposes", TextInput1_3.Text is NOT "",etc.

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 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard