web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Only allow users enter...
Power Apps
Unanswered

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
    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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard