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 / Validation in Office 3...
Power Apps
Answered

Validation in Office 365 Search Users.

(0) ShareShare
ReportReport
Posted on by 115

Hello Everyone.

 

I have a custom form.

In the custom form I have two combo boxes. In the first one I am selecting the name. 

In the second one I am selecting the same person's email. 

The name I select in the first combo box would filter the email of the person automatically. But maybe someone changes it and enters some one else's email. 

 

So, I want to set a validation on submission of the form.

 

Here is how the form looks like:

Unknown123_0-1696449351182.png

Current expression on add button:

If( IsBlank(Dropdown1_42.Selected)||IsBlank(ComboBox2_2.SelectedItems)||IsBlank(ComboBox2_7.SelectedItems),
Notify("Please fill all Required Data.", NotificationType.Error),
Patch(Personnel,
Defaults(Personnel),
{
Role: Dropdown1_42.Selected,
Name: ComboBox2_7.Selected.DisplayName,
Email: ComboBox2_2.Selected.Mail,
ID: If(varEdit,varData.ID,varnewData.ID)
}
);Reset(Dropdown1_42);Reset(ComboBox2_7);Reset(ComboBox2_2)
)

 

So here above I want a filter with blank check like combobox 2_7 . selected name = combo box 2_2 . selected email's name

if not I wills show error otherwise submit the data.

 

 

@WarrenBelz @FLMike @Amik @BCBuizer @SpongYe 

Categories:
  • Verified answer
    ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    HI @Unknown123 If I understood your requirement, then you can try this with your other code.

     

     

    If(
     First(Office365Users.SearchUser({searchTerm: ComboBox2_7.Selected.DisplayName})).Mail <> First(Office365Users.SearchUser({searchTerm: ComboBox2_2.Selected.Mail})).Mail,
     Show the error message 
    )

     

     

    OR

     

    If(
     First(Office365Users.SearchUser({searchTerm: ComboBox2_7.Selected.DisplayName})).Mail <> ComboBox2_2.Selected.Mail,
     Show the error message 
    )

     

     

     

    ------------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.

    Thanks,
    ANB

  • WarrenBelz Profile Picture
    156,921 Most Valuable Professional on at

    Hi @Unknown123 ,

    Maybe simply have the DefaultSelectedItems of ComboBox2_2 as 

    {Mail: ComboBox2_7.Selected.Mail}

    and have it in View mode.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • Unknown123 Profile Picture
    115 on at

    Thanks both

    @ANB @WarrenBelz 

     

    I did a combination of both of your solutions.

    Applied @ANB validation on the button and as @WarrenBelz told to disabled the email combobox. 

     

    @WarrenBelz unfortunately I am not sure that {Mail: combo...} thing didn't work. But thanks for the combo box disable approach that really helped.

     

    @ANB thanks ANB, the overall approached worked as I wanted. 

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

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
timl Profile Picture

timl 122 Super User 2026 Season 2

Last 30 days Overall leaderboard