cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Head Exploding

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

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User II
Super User II

Re: Head Exploding

As you have read, there are a lot of ways to do things. 😀

 

In your case, you will want to be cognizant of

  • Collect is inherently limited by delegation
    • It can only retrieve up to X records, as defined in your app's settings (up to 2000 rows)
    • If what you are retrieving exceeds that setting, you will be missing some data
  • SharePoint has had issues with delegation
  • Collect is more performant in the app
    • You are basically loading the data into local memory, so it does not need to make external calls
    • The data is now static in the app, until a function manipulates it/collects it/etc.
  • Direct Source calls can be relatively performant
    • If you expect the app to be used on a good connection
    • If the data source supports delegation
    • If you structure your calls in an efficient manner

 

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.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.A Drop Down control, using the previous SharePoint list as a source. Filtering with a variable for the User's email.

View solution in original post

6 REPLIES 6
Highlighted
Super User II
Super User II

Re: Head Exploding

I have a few observations/questions:

  1. Why are you retrieving the data using a Flow instead of connecting to the SP list directly?
  2. In most cases, you should set a filter value as a variable (instead of having it be derived, technically, for each row)
    • UpdateContext( { locUserEmail: User().Email } )
    • Filter ( source , emailColumn = locUserEmail )
  3. Are you expecting multiple Title's to come back for the given User?
  4. Are these Title's any different than what you can retrieve, contextually, for the user from O365?
    • Office365Users.UserProfileV2("user@company.com").jobTitle
Highlighted
Helper I
Helper I

Re: Head Exploding

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?

Highlighted
Super User II
Super User II

Re: Head Exploding

As you have read, there are a lot of ways to do things. 😀

 

In your case, you will want to be cognizant of

  • Collect is inherently limited by delegation
    • It can only retrieve up to X records, as defined in your app's settings (up to 2000 rows)
    • If what you are retrieving exceeds that setting, you will be missing some data
  • SharePoint has had issues with delegation
  • Collect is more performant in the app
    • You are basically loading the data into local memory, so it does not need to make external calls
    • The data is now static in the app, until a function manipulates it/collects it/etc.
  • Direct Source calls can be relatively performant
    • If you expect the app to be used on a good connection
    • If the data source supports delegation
    • If you structure your calls in an efficient manner

 

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.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.A Drop Down control, using the previous SharePoint list as a source. Filtering with a variable for the User's email.

View solution in original post

Highlighted
Helper I
Helper I

Re: Head Exploding

Brilliant - one more question...Where do i add this?

 

UpdateContext( { locUserEmail: User().Email } );
Filter ( ListUpdate , Email = locUserEmail )

 

Thanks again.

Highlighted
Super User II
Super User II

Re: Head Exploding

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 )

Highlighted
Helper I
Helper I

Re: Head Exploding

Sorry to be a pain. Is this the correct syntax

Set UpdateContext( { locUserEmail: User().Email } );
Filter ( ListUpdate , Email = locUserEmail )

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Come join us today! Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,497)