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 / Need help! Lookup fiel...
Power Apps
Unanswered

Need help! Lookup field using Choices only brings results from the start of the string not wildcard search

(1) ShareShare
ReportReport
Posted on by

Within the one SharePoint List called 'Specialist Database - NEW', I have a mixture of Practices and Specialists (and other details that are irrelevant).  The fields used for these are: 'Practice' and 'HCP' respectively.

 

For each Practice I also have a field to show which Specialists work in that Practice and vice versa I have a field for Specialists to show which Practices they work in. I realise this is a bit circuitous but it is necessary due to the 1 to many relationship each have with the other.  These additional fields have been created using the Lookup Column type in SharePoint using the Practice or HCP  columns as the source data.  Note also that multiple entries are allowed in the lookup columns.

 

In the generic SharePoint list data entry form (either New Item or Edit), as you type, SharePoint searches and brings back results showing any relevant string - ie if you type Derm, it would bring back 'Dermatologist Professionals' and 'Skin Dermatology Specialists' as the string "derm" is somewhere in the result.  

 

The issue is I have created a form on Power Apps as I want to make certain fields visible when entering data for Practices vs Specialists and in this form, the search function in this lookup field only works by searching for the data entered at the start of the results. In the example before, when entering "Derm" the only result that would come back would be  'Dermatologist Professionals' and 'Skin Dermatology Specialists' would not appear.

 

I have looked for other solutions on the community pages and it seems that one can use the Search function to do this, but I am just not having any luck with constant errors... so any help or guidance on this would be greatly appreciated.

 

To make things easier I will provide some screenshots for one of the cases - A Specialist (HCP) entry that I am trying to enter / search for the Practice they work in.

 

The source data field (ie all the practices are entered into this field) is called Practice_DataCard1:

Dan48_0-1721173479750.png

 

The Practice lookup field (ie string is entered to find the corresponding practices are entered into this field) is called Practice(Lookup)_DataCard1:

Dan48_1-1721173635835.png

 

The current function associated with the lookup field is: 

Choices([@'Specialist Database - NEW'].'Practice (Lookup)')

Dan48_2-1721173704722.png

 

As mentioned I was trying to replace the function by using the Search function in the form of:

 

Search(Choices([@'Specialist Database - NEW'].'Practice (Lookup)') ,DataCardValue9.SearchText,"Value")

 

But this does not work and gives errors.

 

Any support or guidance would be greatly appreciated as I have spent a lot of time trying to make this work so the entry searches and brings back results where the string is in any part of the result.

 

Thank you very much!

Categories:
I have the same question (0)
  • AmínAA Profile Picture
    1,228 Moderator on at
    Greetings Dan!
     
    To my understanding, to my understanding you need a specific field, to display a list of the avalaible choices filtered by another field, which in this case is DataCardValue9.SearchText,"Value" . . . If I did get that right, my recommendation would be for you to try and invert the formula you used, using search inside the Choices, instead of Choices inside of Search. I'm not exactly sure this will work as intended but it's worth a try!
     
    Hopefully this works out for you, in which case feel free to accept this reply as an answer, otherwise feel free to reply for further help!
     
  • MichaelFP Profile Picture
    2,001 Moderator on at
    Hello!
     
    Try to use filter() instead search, you can user Filter(Choices([@'Specialist Database - NEW'].'Practice (Lookup)') ,DataCardValue9.SearchText in Text(Value))
     
    If my answer helped you, please give like this post (👍). If solve your question please mark as solution ✔️. This is help the community.
  • Dan48 Profile Picture
    on at
     
    Thank you very much for your suggestion to use the fiilter() function. I tried this out, but the results still only come back where the search criteria match the start of the result and it does not ring back any results from strings within.  Ie when searching for 'Derm' it will not bring back "Specialist Dermatology" but only "Dermatological Specialist"
     
    Any other thoughts would be greatly appreciated.  
     
  • Dan48 Profile Picture
    on at
     
    Thank you for your suggestion... I understand the logic and this does make sense.  However, in trying to switch the order and move the search() function within the choice() all I get is errors so clearly I am not doing the equation line correctly.  If you are able to help provide that equation with the functions switched I could try and see if that works??
     
    Thanks again!

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 294 Most Valuable Professional

#2
11manish Profile Picture

11manish 210

#3
Valantis Profile Picture

Valantis 169

Last 30 days Overall leaderboard