cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tereza
Frequent Visitor

Populating choice field based on look up field

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)

Screenshot_1.png

What I should do on Project Owner dropdown to be populated from Pms collection?

 

Thanks in advance for your help.

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

3 REPLIES 3
v-siky-msft
Community Support
Community Support

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

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,344)