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 / Low Code Automatic Wil...
Power Apps
Unanswered

Low Code Automatic Wildcard Search on Lookup Control

(0) ShareShare
ReportReport
Posted on by 3
Hi All
 
I have a lookup to a table on a form and have been given a requirement to automatically do a wildcard search so that records containing the search term are shown rather than records that only begin with the search term. 
 
What I was wondering was if there is a low code way of achieving this?
 
The ways that I know of using code are a plugin or a PCF Control.
I have the same question (0)
  • Mark Nanneman Profile Picture
    991 Super User 2025 Season 2 on at
    There may be a solution using a script or plugin, but there's a low-code option that I've used before to enhance the functionality of Model-Driven Apps (I'm assuming here that you're talking about how to improve the lookup function on a Model-Driven App form).  It's a little bit involved, but allows for a lot more flexibility if you want to add some other things besides just the more flexible search.

    Embed A Small Canvas App
    What I like to do is make and embed a small canvas app.  The canvas app's Search() function does the "wildcard" or substring type search you describe and is more useful.  Also, using a small canvas app allows you to prefilter the list of records on the lookup column's related table based on other known factors.  It also allows you to give the user different controls to filter the list of related records.

    E.g. in my example below, I'll pre filter the list of cities based on the state (if we know it already).

    Set(vContact, LookUp(Contacts, Contact = Coalesce(GUID(Param("id")))))
     
    Steps
    1.   Set up your canvas app to lookup the record it's embedded on when loaded by reference to the "id" parameter in the url (we'll tell the Model-Driven App to give us this ID later on).  Do this by adding a code to the OnVisible property of the screen, something like
    2.  Set up your canvas app to display a gallery of related records
    3.  Give it a text input search control
    4.   Put a Search() expression around your datasource in the gallery (and any necessary filters)      

      ​​​​​​​

    5.  Give the user a button or control to select the record after they search



    6.  Give the user a final confirm button that patches the selected related record to the lookup field.

    7.   Click the share button on your app, copy the link



    8.   Add an "External Website" component to your form (there is a "Canvas App" component, but I prefer to just use the "External website" component.
    9.   Paste the url to the "External Website" component and make sure you check the "Pass record object-type code and unique identifyer as parameters" option.



    10.   Publish your form and load it in your app to test. 
      You'll probalby want to tweak your canvas app to make it responsive to different browser sizes, etc.


    Search and click on the city record I want:

    Click the "Set Lookup" / "confirm" button.
    The app can give you a confirmation and a note to reload the form if you like.


    Hope that helps!

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard