cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Make the search in a lookup column in powerapps better?

I got this Lookup column in SP list that i've imported into powerapps into a form, I made the box IsSearchable=True and I can search, it works.

 

But can I somewhere insert more "Keyword" so the search gets better?

 

Example:

If I have to search for "Mr. Berta Jonsson" I have to type "Mr." If I type "Berta Jonsson" I wont get any results, just blank.

1 ACCEPTED SOLUTION

Accepted Solutions

@Anonymous 

Yes, you can do that.  You have to do two more things though for it to work properly.

1) Set the Default.  You will want to have any previous value appear if you edit a record, so, to get that to work, you will need to set the DefaultSelectedItems property of the Combobox to Filter(yourLookupList, ID=ThisItem.Cards.Id)

 

2) You will need to set the UpdateProperty of your DataCard to the following:

{
   Value: yourComboBox.Selected.Title,
   Id: yourComboBox.Selected.ID,
   '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
}

Substitute the name of your combobox, and the Title to whatever field you have defined in SharePoint to use from the Lookup list.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

7 REPLIES 7
RandyHayes
Super User
Super User

@Anonymous 

In order to find those kind of results, you need to incorporate either Search or IN functions.  Neither of these are delegable to SharePoint - only StartsWith (and thus the results you see).

Depending on the size of your datasource and the possibility of reducing the results to a subset (i.e. perhaps you only need to search like this on a small range of records), the delegation issue can be worked around.

If you have any formulas or screenshots to explain your scenario further, please share.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Anonymous
Not applicable

@RandyHayes Hello and thanks for the reply!

 

Its a small record, contains only 340 items.

 

Its a DatacardValue in a form in powerapps, its the type combobox and its searchable.

 

Items property is:

Choices([@'Logg'].Cards)

Searchfield:

["Value"]

IsSearchable:

true

 

 

Bengtfors korrekt.PNG

 

 

Bengtfors fel.PNG

@Anonymous 

Ah got it...I did not get that this was a ComboBox.  

Yes, a ComboBox *should* be doing exactly what you want.  

In your scenario, what happens if you just type in Norra - does it give you results?

 

Here is the ComboBox with searching as it should be:

ComboBoxSearch.gif

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Anonymous
Not applicable

@RandyHayes 

 

Unfortunately that doesnt work for me. This column is a lookup column in sharepoint list, its connected to another list on sharepoint. When I insert it into a form in powerapps it says its a combobox in powerapps. I try to just search for "Norra" but it doesnt work...

@Anonymous 

Ah, it's a lookup column.  Yes you will have the results you are seeing with them due to the nature of them being complex data types in SharePoint.

 

I would recommend that you add the list that is defined for the Lookup column to your App and then base your ComboBox on that list rather than on Choices.

ComboBoxSearch2.gif

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Anonymous
Not applicable

@RandyHayes 

 

Alright I understand. Can I put this new combobox into my form and patch that field somehow also?

@Anonymous 

Yes, you can do that.  You have to do two more things though for it to work properly.

1) Set the Default.  You will want to have any previous value appear if you edit a record, so, to get that to work, you will need to set the DefaultSelectedItems property of the Combobox to Filter(yourLookupList, ID=ThisItem.Cards.Id)

 

2) You will need to set the UpdateProperty of your DataCard to the following:

{
   Value: yourComboBox.Selected.Title,
   Id: yourComboBox.Selected.ID,
   '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
}

Substitute the name of your combobox, and the Title to whatever field you have defined in SharePoint to use from the Lookup list.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (2,596)