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

Need help to remove duplicated item from Lookup field

Hi,

 

I have a power apps application referenced to List A. It has two fields. One choice field Dep and lookup field Mgr.

The Mgr lookup from List B.

List B would looks like

 

Department   Manager

A                         People A

A                         People B

B                          People A

 

I use the expression to filter manager based on  Department

 


Filter(
Choices([@ListA].Mgr),
Value in Filter(
[@ListB],
Department = DataCardValueSelected.Value
).Manager
)

 

However, When I try to set selected Dep item to A, It also show duplicated item because The Department B also managed by People A with different item ID.  

 

I also tried the distinct function but it just convert Table type to result type. So when I submit form, the manager field won't be submitted. So how can I prevent items like  B people A from being filtered to remove duplicated items.

 

I tried to use 

 

1 ACCEPTED SOLUTION

Accepted Solutions
gabibalaban
Super User
Super User

Hi @Yukdin ,

Well, Distinct () function is a good idea to use it inside your DropDown/ComboBox:

Distinct(
    Filter(
      Choices([@ListA].Mgr),
              Value in Filter([@ListB],Department = DataCardValueSelected.Value
    ),Manager
).Result

but this usage must be followed by a change in Update () property of the datacard control like:

LookUp(Choices([@ListA].Mgr), Value = DropDown.Selected.Result)

 

Hope it helps ! 

View solution in original post

2 REPLIES 2
gabibalaban
Super User
Super User

Hi @Yukdin ,

Well, Distinct () function is a good idea to use it inside your DropDown/ComboBox:

Distinct(
    Filter(
      Choices([@ListA].Mgr),
              Value in Filter([@ListB],Department = DataCardValueSelected.Value
    ),Manager
).Result

but this usage must be followed by a change in Update () property of the datacard control like:

LookUp(Choices([@ListA].Mgr), Value = DropDown.Selected.Result)

 

Hope it helps ! 

View solution in original post

Hi gabibalaban,

 

Thank you so much! Change “Update" property fix my problem!

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,634)