Hi everyone ,
I am trying to find a way people picker field in a PowerApps SharePoint form based on the value of a separate drop down.
I have created I share point list called Countries , that has "Title" and "ID" as columns.
I also have another share-point list called ProjectManagers that has "User" (person or group) and "Country" look up columns .
In my powerapp form I would like the ProjectOwner dropdown shows the values based on the Country selected value.
I have set the items property of county dropdown to : ShowColumns(Countries,"Title","ID")
I tried to make a collection with the filtering
On Change (Country Dropdown) : Clear(Pms);
Collect(
Pms, Filter(ProjectManagers,Country.Id=CountryDC.Selected.ID).User)
What I should do on Project Owner dropdown to be populated from Pms collection?
Thanks in advance for your help.
Solved! Go to Solution.
Hi @Tereza ,
Ok, I got you. Please try to modify the OnChange property of Country Dropdown as follows:
ClearCollect(Pms,ShowColumns(AddColumns(Filter(ProjectManagers,Country.Id=CountryDC.Selected.ID),"Claims",User.Claims,
"Department",User.Department,
"DisplayName",User.DisplayName,
"Email", User.Email,
"JobTitle",User.JobTitle,
"Picture",User.Picture
),"Claims","Department","DisplayName","Email","JobTitle","Picture"))
Then set the DefaultSelectedItems property of Project Owner to Pms.
Hope this helps.
Sik
Hi @Tereza ,
The Project Owner is also Person or Group column, right?
If so, please try to set the DefaultSelectedItems property to First(Pms).User
Expect that, you can directly set the default items without a collection, like this:
LookUp(ProjectManagers,Country.Id=CountryDC.Selected.ID).User
Hope this helps.
Sik
Hi @v-siky-msft ,
Thanks for your reply .Yes Project Owner is Person or group column , I tried this solution but it populates me only the first User.
The look up function fetches me only the first record . I would like to display all the Users in this particular country.
Hi @Tereza ,
Ok, I got you. Please try to modify the OnChange property of Country Dropdown as follows:
ClearCollect(Pms,ShowColumns(AddColumns(Filter(ProjectManagers,Country.Id=CountryDC.Selected.ID),"Claims",User.Claims,
"Department",User.Department,
"DisplayName",User.DisplayName,
"Email", User.Email,
"JobTitle",User.JobTitle,
"Picture",User.Picture
),"Claims","Department","DisplayName","Email","JobTitle","Picture"))
Then set the DefaultSelectedItems property of Project Owner to Pms.
Hope this helps.
Sik