Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
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

  • Verified answer
    v-bofeng-msft Profile Picture
    on at
    Re: Only allow users enter text that exist in another data source?

    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

  • apham Profile Picture
    19 on at
    Re: Only allow users enter text that exist in another data source?

    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

     

  • apham Profile Picture
    19 on at
    Re: Only allow users enter text that exist in another data source?

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

    Thanks. 

  • v-bofeng-msft Profile Picture
    on at
    Re: Only allow users enter text that exist in another data source?

    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

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 89 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 72 Super User 2025 Season 1

#3
mmbr1606 Profile Picture

mmbr1606 71 Super User 2025 Season 1

Overall leaderboard