I have a power app in which users will need to select enter data relating to their accounts and sites.
I want users to only see accounts which only relate to them within a dropdown box when they log in to the app.
The Items property of my dropdown box is Choices([@'Operational Review Commentary_1'].'UKI Accounts')
I have the following formula within the onstart property however this doesn't seem to work as my accounts Sharepoint list is a reference list and the email field is within this list. Is this the right approach if not how would I ensure that my dropdown only shows the accounts related to the user logged in
Set(
varUser,
User()
);
Set(
isUserSPList,
!IsBlank(
LookUp(
'UKI - Accounts List' ,
'Access Email' = varUser.Email
)
)
)
@Anonymous ,
So you need
ClearCollect(
colAccounts,
Filter(
'UKI - Accounts List' ,
User().Email in 'Access Email'.Email
)
)
but as noted, this is not Delegable. If you wanted the users accounts in the newest 2,000 (and had your Delegation limit set to this)
With(
{
wList:
Sort(
'UKI - Accounts List',
ID,
Descending
)
};
ClearCollect(
colAccounts,
Filter(
wList,
User().Email in 'Access Email'.Email
)
)
)
For your second question, there needs to be a list somewhere with the relationship between those values and then you would not use the choices (not on the second one anyway), but filter that list based on the first drop-down and display the second field records based on the filter. This is a different subject to your post and needs to be on another thread if it turns into a conversation, Has your initial query been solved ?
@WarrenBelz Aaaah yes, it is a multi-select person field. Thanks for making it clear. Can you please assist with one last query?
I have two Dropdowns titled Segment & UKIAccounts. The task is if an individual selects a segment within the segment dropdown this then filters the UKIAccounts dropdown to showcase the accounts related to that segment. Below are the Item properties of both dropdowns. Whats the best approach to this?
Segment Dropdown Items Property
UKIAccounts Items Property
Hi @Anonymous ,
At last I think the proper reason has emerged - is that a multi-select person field ? If so, you need a different filter and it will never be Delegable.
@WarrenBelz For some reason this is still not working. Am I missing something? The only other message which shows up is the below.
Only other message which shows up
@Anonymous ,
I am surprised that is the only warning (it is really doing nothing) - you need to make a Collection with that code
ClearCollect(
colAccounts,
Filter(
'UKI - Accounts List' ,
'Access Email'.Email = User().Email
)
)
the colAccounts is their list.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
@WarrenBelz Sorry, I believe there may be a bit of confusion. The code I have is within the App OnStart property, therefore I have been updating the Onstart property with the formula suggested. Aim is when a user logs in this list is automatically filtered at the start therefore when an individual uses a dropdown they can only see which accounts belong to them.
Hi @Anonymous ,
The list size does not matter with a Delegation warning as you might increase it in the future and Power Apps simply flags that it is not Delegable, however, if that is a Person field, it should be Delegable (see my test below with no warning)
Are you using that alone or in conjunction with other Filter/s. Can you please post the exact code you are using in Text and also a screenshot of the error.
@WarrenBelz Unfortunately, I am still getting the same error with the updated formula. My list is around 1k would this still be an issue?
@Anonymous ,
Not the best column type to use with large data sets (I do not use them at all), but in this case, the below should work
Filter(
'UKI - Accounts List' ,
'Access Email'.Email = User().Email
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
@WarrenBelz Its a person or group type field in SharePoint.
This is the message I get
WarrenBelz
637
Most Valuable Professional
stampcoin
570
Super User 2025 Season 2
Power Apps 1919
473