Hello,
I have an app whereby I have a Division and Department and Cost Centre dropdown fields. The idea is for the system to populate the Division and Department automatically based on the current logged in user. There is also a cost centre dropdown field with a cost centre value for each user, which should populate based on that logged in user also. The challenge is, some users are tied to multiple cost centres so whereas the Division and Department are singular and will remain the same, how can the system provide the logged in users with all the cost centres assigned to them, so based on what they want to enter, they can select from the four or five cost centres, or for those who only have one assigned to them, that one alone will show. Any guidance on how to achieve this appreciated.
I think I figured out the issue. Thanks @v-qiaqi-msft for the formula above. I needed to replace email with DisplayName and also created a variable on AppStart to set Set(varUser,User()); - so there were some slight changes to your formula but it works well now. The updated formula is: ForAll(Filter('Test Div Dept Cost Centre',Employee.DisplayName=varUser.FullName).'CCentre Dropdown', 'CCentre Dropdown'.Value) and they were applied and changed accordingly for the Division and Department fields. Works like a charm now. Thanks again @v-qiaqi-msft for that formula and also thanks to @Amik for the timely feedback, initial troubleshooting and assistance with this. Will mark as solved.
I cannot seem to get this formula to work. My user field in the SharePoint list is called "Employee" so I used Employee.Email=User().Email).
Here is my completed formula but the dropdown shows no values:
ForAll(Filter('Test Div Dept Cost Centre',Employee.Email=User().Email).'CCentre Dropdown', 'CCentre Dropdown'.Value)
The field in SharePoint is also a dropdown list. Should this be so or is something else missing?
Hello,
Sorry for the delayed feedback.
I have one SharePoint list called UserData and text fields for Division, Department and Cost Centre. However, in the powerapp, I created dropdown fields and am looking at creating the relationship between each field by updating the items property. I am not sure if this is the best approach, nor if the above formula will work with the option I am using, or if I need to have dropdown fields in SharePoint to tie to the dropdowns in Powerapps. Any further guidance appreciated.
Hi @joshieboy,
Here is a simple demo based on the following conditions:
1). Cost Centre is a single Choice type in your SP list
2). You have alread had a table with relationship between Cost Centre and Division and Department
3). There is a column saving users, here I name it with User
Set the Items property of the Cost Centre dropdown:
ForAll(Filter(list,User.Email=User().Email).'Cost Centre','Cost Centre'.Value)
So do Division and Department dropdown control, replace 'Cost Centre' with Division and Department.
Hi @joshieboy - unfortunately not. I am still not clear on the last two questions. I will rephrase:
2. How is the app supposed to know which Division, Department and Cost Centre/s are associated to which users? Is there a mapping table you're using?
3. By field type, I meant what are the data types in your SharePoint list for these fields. Are they Single Line Text, Choice etc. ?
Hello @Amik
The data source is a SharePoint list and each of the fields are dropdowns. Cost Centre cannot be multiselect as users have to enter individual budget records for a single cost centre, but some users have multiple centres assigned to them, so whereas most should auto populate with the individual cost centre based on your logged in name, the ones with multiple should be able to choose any one from the multiple assigned to them, then complete the other fields and submit. Hope this clears it up
Hi @joshieboy -
------------------------------------------------------------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.
If you like my response, please give it a Thumbs Up.
Imran-Ami Khan
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2