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 / Only allow users enter...
Power Apps
Answered

Only allow users enter text that exist in another data source?

(0) ShareShare
ReportReport
Posted on by 19

Hello,

I have two SharePoint lists, Account Request 1 and Account Request 2. 

The Account Request 2 SharePoint list has  a field named Companylookup that contains all the company names. (Apple, Google, Amazon, etc.... ) 

On the Account Request 1 SharePoint list I have a field named Company. I want users to type in the company name on this field that only exists on the Companylookup field from Account Request 2 or else throws an error message. Could you please show me how I can accomplish this using PowerApps form? 

 

Thank you.

AP

I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @apham :

    Could you please tell me what Companylookup field is?Is it a text filed?

    I assume Companylookup field is a Text filed.Please try:

    Set the textinput control of "Company" field's OnChange property to:

     

    If(IsBlank(Lookup('Account Request 2',Companylookup=Self.Text)),Notify("Error Message"))

     

    Best Regards,

    Bof

  • apham Profile Picture
    19 on at

    Bof, I'm sorry, the Companylookup field is number field. 

    Thanks. 

  • apham Profile Picture
    19 on at

    I took a different approach. I created a combobox in the Company Datacard

     

    apham_8-1622140228336.png

     

     

     

     

    I set the Default property for Company text box 

    If(Form6.Mode = FormMode.View, Parent.Default, Concat(ComboBox7.SelectedItems,(CompanyLookup)))

    apham_6-1622140087852.png

     

    I set the Items property for the ComboBox

    apham_5-1622139935649.png

    apham_9-1622140616055.png

     

     

    Now, how do I prevent users from entering a value that does not exist from the dropdown list? I want to put a message like, "value must exist from the list below")  Thank you. 

     

    apham_4-1622139736429.png

     

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @apham :

    Please try----

    Set the textinput control's OnChange property to:

    If(
     IsBlank(
     Lookup(
     'Account Request 2',
     Companylookup=Value(Self.Text)
     )
     ),
     Reset(Self);Notify("value must exist from the list below")
    )

     Best Regards,

     Bof

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 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard