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 / Mandatory Fields in a ...
Power Apps
Answered

Mandatory Fields in a Gallery?

(0) ShareShare
ReportReport
Posted on by 66

Hey guys

 

Really stumped on this one! 

 

I have a Gallery in my app that my users track their coaching with, and I want to make the bottom two dropdowns mandatory only when my user chooses that they coached that person. If they choose something like "not applicable" or "vacation", then I don't need the bottom two dropdowns to be mandatory. 

 

CoachingDropDown is the dropdown where my users choose if they "Coached", "Vacation","Sick" or "Not applicable" for the period. AdoptionDropDown and CurrectBPDropDown are the two dropdowns that I need turned mandatory if they choose "Coached" and if not, then the error message to pop up. The below code is just not working for me. Any idea? 

 

If(CoachingDropDown.SelectedText.Value<>"Coached this week | A déjà reçu de l’encadrement",If(CoachingDropDown.SelectedText.Value="Coached this week | A déjà reçu de l’encadrement"&&CurrentBPDropDown.SelectedText.Value<>"Not applicable | Sans objet"&&AdoptionDropDown.SelectedText.Value<>"Not Applicable | Sans objet",Patch(CoachingData,ThisItem,{Coached:CoachingDropDown.Selected,CoachingType:CoachingTypeDropDown.Selected,BestPractices:CurrentBPDropDown.Selected,AdoptionStaircase:AdoptionDropDown.SelectedText.Value}),UpdateContext({ErrorMsg: true })))
Capture.JPG
Categories:
I have the same question (0)
  • Verified answer
    yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @smartin 

     

    Can you try to update the expression to:

     

    If(CoachingDropDown.Selected.Value = "Coached", If(AdoptionDropDown.Selected.Value <> "Not Applicable" && CurrentBPDropDown.Selected.Value <> "Not Applicable", Patch(CoachingData,ThisItem,{Coached:CoachingDropDown.Selected,CoachingType:CoachingTypeDropDown.Selected,BestPractices:CurrentBPDropDown.Selected,AdoptionStaircase:AdoptionDropDown.Selected.Value}), Notify("Adoption and Current BP is madatory")),Patch(CoachingData,ThisItem,{Coached:CoachingDropDown.Selected,CoachingType:CoachingTypeDropDown.Selected,BestPractices:CurrentBPDropDown.Selected,AdoptionStaircase:AdoptionDropDown.Selected.Value}))

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • smartin Profile Picture
    66 on at

    Thank you @yashag2255 

     

    I didn't even know about the Notify Function! Very much appreciate your solution and timely answer! 🙂

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 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard