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

Search and Filter a Sharepoint list

Hi all,

 

I have a Sharepoint List with a couple of Choice (dropdown) columns.

 

In the powerapp, I have the sharepoint list as a data connection with a gallery that should display all items. I have added a text input search bar which allows a user to search by Title. This works perfectly.

 

 

Search('SharepointListName', SearchBarName.Text, "Title")

 

 

I'd also like to add a filtering option for users via a dropdown that filters one, ideally two of the choices in the sharepoint list. So far, I've got a form that is successfully connected to the correct Sharepoint Choice. The problem I'm having is I can't get the get the Gallery to filter using the form dropdown and search using the text input.... actually, the new code is absolutely broken.

 

 

 

Sort('SharepointListName',(Search(, SearchBarName.Text, "Title") Filter(DataCardValue51, "SharepointChoiceName"))

 

Appologies for the coding nightmare above, as you might be able to tell, it's not one of my strengths. Can anyone help me to get this working please?

 

18 REPLIES 18
Anonymous
Not applicable

adding in @emmac to review. 

 

@Anonymous 

@Drrickryp , using the StartsWith I still have a delegation issue! See the screenshot...

Hi @MisterMagoo 

The syntax for the Filter(StartsWith() should be of the form 

Filter( Customers, StartsWith( Name, SearchInput.Text ) )

as is shown in the documentation for StartsWith() canvas-apps/functions/function-startswith
Where the first element of the StartsWith() function is the column and the second part is the Text to be searched. In your example, it appears that the Text to be searched is before the column.  I'm not sure if that is the reason why you have a delegation error.  

Thanks @Drrickryp , I swapped the 2 values but I still have the same delegation warning... 

My need is quite simple. Say, I have a sharepoint list ("ContractList") with a list of associations (A) contract name (column "ContractName") and (B) URL (column "Link") associated to the contract. 

The user must select one contract from a listbox ("ContractGallery") listing all the contracts, and clicking on an "Open Contract" icon he should launch the associated URL.

 

I tried the 3 different version below. All 3 gave me a delegation warning! I am getting mad 🙂

Thanks for your help! 

 

Launch(First(Filter(ContractList,ContractGallery.Selected.Contract in '{ContractName}')).'{Link}');

Launch(First(Filter(ContractList,StartsWith('{ContractName}',ContractGallery.Selected.Contract))).'{Link}');

Launch(LookUp(ContractList,'{ContractName}'=ContractGallery.Selected.Contract,'{Link}'));

I've found the issue. The code is correct in all 3 cases.

What is giving a delegation error is the fact that I am actually looking into the '{Name}' column of the Sharepoint List, and not in the '{ContractName}' I mentioned in my example. 

Strange, absolutely strange. Looking into all other columns is fine. If I look into THAT particular column, I have a delegation warning...

Oh Magoo, you've done it again!

@Drrickryp What did I do again? Making mistakes? Oh sure, every day! 🙂 But what is the mistake I did this time? 🙂 Is "Name" a known reserved field in Sharepoint lists?

Ahahahah 🙂 (non-native English speaker here, I did not know that 🙂

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (26,733)