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 / How to validate a drop...
Power Apps
Answered

How to validate a dropdown value and a text input

(0) ShareShare
ReportReport
Posted on by 97

Hello, 

 

I have a dropdown that points to all of our Job Titles, and a text input called "Clone as Title"  this field is autopopulated by the Dropdown "Clone as" which is a people picker. I need to Validate that the "Clone as Title" text input is the same title they selected in the dropdown "jobtitle" , i would like if once they select someone with a different title in the clone as a notify message (informational) pops saying the titles don't match please double check or something along those lines. 

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    Hi @mfigliulo ,

     

    What do you have in the Items property of the Job Title dropdown?

     

    Are you using the Text Input for anything other than checking if the job title selected from the Job Title Dropdown is the same as the job title selected from the "Clone as" People Picker?

     

    If not, on the OnChange property of the "Clone as" People Picker, try adding:

     

    If(
     !(Self.Selected.JobTitle = DropdownJobTitle.Selected.Value),
     Notify(
     "Titles don't match",
     NotificationType.Information
     )
    )

     

     

    If the Job Title dropdown is also a People Picker, you can replace "DropdownJobTitle.Selected.Value" with DropdownJobTitle.Selected.JobTitle.

     

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

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

  • mfigliulo Profile Picture
    97 on at

    @Amik 

    this is my Job title dropdown.

    mfigliulo_0-1690226931552.png

    and this is my Clone as (People Picker) & Clone as Title(TextInput) 

    mfigliulo_1-1690227006795.png

    mfigliulo_2-1690227023803.png

     

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    Hi @mfigliulo , I am still not clear on what purpose the Text Input control serves, but in either case you could try adding the below into the OnChange property of the Job Title Dropdown:

     

    If(
     !(Self.Selected.Value = DataCardValue86.Text),
     Notify(
     "Titles don't match",
     NotificationType.Information
     )
    )

     

     

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

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

     

     

  • mfigliulo Profile Picture
    97 on at

    So i added the 

    If(
    !(DataCardValue85.Selected.JobTitle = DataCardValue48.Selected.Value),
    Notify(
    "Titles don't match",
    NotificationType.Information
    )
    )

     

    On my OnChange property of the DatacardValue86 "Clone as" dropdown and even if the titles match i still get the message.  

     

    Use case is if i select "Exchange Admin" from my job title dropdown, then select "Clone As" John smith but his title is Powerapps Developer i should get a message.  but only if the clone as persons title differs from the selected job title picked before. and if i select "Clone as" Tony Stark and his title is Exchange Admin then no notification pops up. 

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @mfigliulo I understand the use case, but I do not understand the purpose of the Text input control (I have mentioned this twice and still no clarity).

     

    Whatever the reason for the Text Input control, the code I provided will work if you follow the instructions.

     

    If you apply the expression I gave to the OnChange property of the Job Title Dropdown (DataCardValue48) exactly as written, this will display a notification message if the selected job title from DataCardValue48 is different from the job title in the Text Input control.

     

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

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

  • mfigliulo Profile Picture
    97 on at

    @Amik 

     

    The Text Input control is the value im validating against the job title dropdown.

     

    I added the code to the job title dropdown, it throws the notification as soon as a select a title which i get because the other field is blank but i need to only pop up when the clone as is populated.  Also it doesnt pop upo when i select a clone as persons title thats different only when i change the job title dropdown. 

  • Verified answer
    Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @mfigliulo in that case I do not think we need the Text Input control to validate the output of the dropdown controls. We can use the Self function for this. 

     

    Try the below:

     

    On Change Property for DataCardValue48:

     

    If(
     !(Len(Self.Selected.Value) = 0) && !(Len(DataCardValue85.Selected.JobTitle) = 0) && !(Self.Selected.Value = DataCardValue85.Selected.JobTitle),
     Notify(
     "Titles don't match",
     NotificationType.Information
     )
    )

     

    On Change Property for DataCardValue85:

     

    If(
     !(Len(Self.Selected.JobTitle) = 0) && !(Len(DataCardValue48.Selected.Value) = 0) && !(Self.Selected.JobTitle = DataCardValue48.Selected.Value),
     Notify(
     "Titles don't match",
     NotificationType.Information
     )
    )

     

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

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

     

     

  • mfigliulo Profile Picture
    97 on at

    @Amik 

     

    AH ok and the above seems to ALMOST work , i selected different titles notification worked perfectly . However, when i selected the same title it still popped up 

     

    mfigliulo_1-1690232305681.png

     

     

     

    mfigliulo_2-1690232333306.png

     

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @mfigliulo - if a notification still appears  even when differences are not detected, how could my suggestion be working perfectly? It either works or does not work.

     

    Do you mean to say that the suggestion works, but not when "Microsoft 365 Administrator" is returned from both dropdowns?

  • mfigliulo Profile Picture
    97 on at

    I meant it works perfectly outside of it matching, like it doesnt warn about values being blank.  You are right it doesnt work exactly as i need it to. 

     

    It doesnt work if both titles match , it still tells me they dont match when they in fact do 

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard