cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ganesan_gowri
Helper IV
Helper IV

Remove duplicates

My screen looks like

screen.png

In Dropdowns i list out the name from the Datasource"Employee"

         Items: ShowColumns(Employee, "Name", "ID")

Next To dropdown i add a Label to show the Id of the Selected dropdown 

         text: Dropdown1.Selected.Name & "" & Dropdown1.Selected.ID

both are works fine.

 

Now i have a duplicate values in the dropdowns. So i have to remove the Duplicates by giving formulas in Dropdowns. i tried but got error.

please tell me how to Code. Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi@ganesan_gowri,

Could you please share a bit more about your scenario, is there only one Dropdown, is it for 'Name' or 'ID'?

Based on the issue that you mentioned, do you want to remove the duplicates from the dropdown?

Since there are duplicates in your column, I assume that you have an Excel table as your data source.

I have a test on my side, please take a try as below.

Set the Dropdown Items property as below:

 

Distinct(ProductionProcess,NAME)

 

Add a Label and set the Text property as below:

 

LookUp(ProductionProcess,NAME=Dropdown1.Selected.Result,IDen)

 

After that, you can populate the Label based on the Dropdown selected without duplicate values.

If you want to populate a Gallery every clicking the Dropdown, you can set the OnSelect property of the Dropdown as below:

 

Collect(
    Temp,
    {
        Name: Dropdown1.Selected.Result,
        IDENTY: LookUp(
            ProductionProcess,
            NAME = Dropdown1.Selected.Result,
            IDen
        )
    }
)

 

Add a blank Gallery and insert 2 Labels to it. Set the Text property as below:

 

NameLabel Text property:
ThisItem.Name
IDLabel Text property:
ThisItem.IDENTY

 

Please check the Gif as below.

0803Gif03.gif

Best Regards,

Qi

Best Regards,
Qi

View solution in original post

2 REPLIES 2
eka24
Community Champion
Community Champion

To remove duplicate use disctint.

Onvisible of the screen create a collection;

ClearCollect (EmployeeCol, AddColumns (Employee, "NameAndID", Name&ID))

 

Then on the Dropdown items:

Distinct(EmployeeCol, NameAndID)

on the Items property of the dropdown.

 

Finally in your Label;

Dropdown1.Selected.Result)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

v-qiaqi-msft
Community Support
Community Support

Hi@ganesan_gowri,

Could you please share a bit more about your scenario, is there only one Dropdown, is it for 'Name' or 'ID'?

Based on the issue that you mentioned, do you want to remove the duplicates from the dropdown?

Since there are duplicates in your column, I assume that you have an Excel table as your data source.

I have a test on my side, please take a try as below.

Set the Dropdown Items property as below:

 

Distinct(ProductionProcess,NAME)

 

Add a Label and set the Text property as below:

 

LookUp(ProductionProcess,NAME=Dropdown1.Selected.Result,IDen)

 

After that, you can populate the Label based on the Dropdown selected without duplicate values.

If you want to populate a Gallery every clicking the Dropdown, you can set the OnSelect property of the Dropdown as below:

 

Collect(
    Temp,
    {
        Name: Dropdown1.Selected.Result,
        IDENTY: LookUp(
            ProductionProcess,
            NAME = Dropdown1.Selected.Result,
            IDen
        )
    }
)

 

Add a blank Gallery and insert 2 Labels to it. Set the Text property as below:

 

NameLabel Text property:
ThisItem.Name
IDLabel Text property:
ThisItem.IDENTY

 

Please check the Gif as below.

0803Gif03.gif

Best Regards,

Qi

Best Regards,
Qi

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.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

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 (3,721)