Hi, So I started with PowerApps last Friday so be gentle. Through various youtubes etc I have cobbled together more or less most of what i need. So here is the issue. Created an app that calls a flow , gets some data from a sharepoint list and brings it back to a collection for use in a dropdown. Issue is the filter is just not working. The collection contains Email and Title. I want the title to appear in my dropdown when Email equals current users email. I seem to just get all assets(Titles) in my dropdown so the lookup from my email to the email in the list is not working?
ClearCollect(SPMigrationMappingItemsColl,GetAssetFromList.Run("/_api/lists/getByTitle('ListUpdate')/items?$select=Title,Email&$Filter(Email = User().Email"))
So ListUpdate is my sharepoint list that contains email and title.
GetAssetFromList is the Flow I call.
Please help as this should be easy I'd hope for someone with more brains than me....meaning 99% of this community.
Cheers
Solved! Go to Solution.
As you have read, there are a lot of ways to do things. 😀
In your case, you will want to be cognizant of
It seems like you're looking to obtain a Drop Down list of hostnames (Title), based on the current user's Email. You have a SharePoint list, which has the resulting hostname (Title) and a corresponding Email column.
You should be able to simply configure the Drop Down as a direct filter of the SharePoint list, using a variable. You'll want to confirm this works for you, and your performance expectations. Keep in mind, since the User's email won't change in the session, it should be a single call and then remain populated. If you want to, then Collect that same filter into a collection, but it may not be necessary. See attached for an example, on a smaller scale.
Simple list with Title, and a custom Email field.
A Drop Down control, using the previous SharePoint list as a source. Filtering with a variable for the User's email.
I have a few observations/questions:
Hi Gareth, So I think i read somehwhere this would be more efficient to use a collection as my List contains approx 10k lines. Titles are actually HostNames and not available to me through Office365. Yes there will be frequent occasions where an email has multiples hostnames (Titles) against it, so all of them need to be listed in the dropdown.
I am doing this completely incorrectly?
As you have read, there are a lot of ways to do things. 😀
In your case, you will want to be cognizant of
It seems like you're looking to obtain a Drop Down list of hostnames (Title), based on the current user's Email. You have a SharePoint list, which has the resulting hostname (Title) and a corresponding Email column.
You should be able to simply configure the Drop Down as a direct filter of the SharePoint list, using a variable. You'll want to confirm this works for you, and your performance expectations. Keep in mind, since the User's email won't change in the session, it should be a single call and then remain populated. If you want to, then Collect that same filter into a collection, but it may not be necessary. See attached for an example, on a smaller scale.
Simple list with Title, and a custom Email field.
A Drop Down control, using the previous SharePoint list as a source. Filtering with a variable for the User's email.
Brilliant - one more question...Where do i add this?
UpdateContext( { locUserEmail: User().Email } );
Filter ( ListUpdate , Email = locUserEmail )
Thanks again.
UpdateContext is a function and can be invoked when the screen loads, or using a button. You can also do it as a Set (global variable) when the app loads initially.
The Items property of your Drop Down is where you'll put Filter ( ListUpdate , Email = locUserEmail )
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
205 | |
70 | |
49 | |
49 | |
20 |
User | Count |
---|---|
252 | |
124 | |
84 | |
76 | |
73 |