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
Dual Super User
Dual 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
Dual Super User
Dual 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 ! 

Hi gabibalaban,

 

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

 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,493)